setQuery($query3);$db->query();//$num_prod = $db->getNumRows();$num_prod = 15;$row_prod = $db->loadAssocList();$t=0;?>Your vendor ID = item # Item Code Item Description Price UOM size type " type="text" value="" size="10" maxlength="30"> " type="text" value="" size="10" maxlength="80"> " type="text" value="" size="8" maxlength="8"> " type="text" value="" size="10" maxlength="10"> " type="text" value="" size="10" maxlength="10"> " type="text" value="" size="10" maxlength="10">more......So this is a 100% custom code app.Everything is working 100% except the screen layout is "out of control". It is actually wider than the whole template and it steps "on top of" some of the other containers on the page. I can't seem to control the width of the table or the width of the individual columns in the table. I tried adding this in my custom code but it had NO effect.th { width: 10px: !important; }table { width: 50%: !important; }I'm so close, as the function is correct, If I could ONLY get the display right. :? Please Help,Mr Fitz"> Custom Form - Forums

Forums

Custom Form

the_fitz 06 Aug, 2013
Hi All,

I am pretty familiar with CFV4. I have designed a table with 15 rows and 6 or 7 columns. Each row represents a record. The table actually has a only 2 rows, and uses a for loop to read and write the 15 rows.

like this..
$id_auto = $row_profile[0]['id_auto'];
$query3 = "select * from joom_rex_products where p_vend_id_link = $id_auto";
$db->setQuery($query3);
$db->query();
//$num_prod = $db->getNumRows();
$num_prod = 15;
$row_prod  = $db->loadAssocList();

$t=0;

?>


<h2>Your vendor ID = <?php echo $id_auto ?>
</h2>
<table width="100%" border="1" cellspacing="2" cellpadding="2">
    <tr>
        <th  scope="row">item #</th>
        <th scope="row">Item Code</th>
        <th >Item Description</th>
        <th>Price</th>
        <th >UOM</th>
        <th>size</th>
        <th >type</th>
    </tr> 
<?php
    for ( $t = 0; $t <= $num_prod-1; $t++ ) {
?>
    <tr>
        <th scope="row"><?php echo $t+1 ?></th>
        <th scope="row"><input name="p_item_code<?php echo $t ?>" type="text" value="<?php echo $row_prod[$t]['p_item_code'] ?>" size="10" maxlength="30"></th>
        <td><input name="p_item_desc<?php echo $t ?>" type="text" value="<?php echo $row_prod[$t]['p_item_desc'] ?>" size="10" maxlength="80"></td>
        <td><input name="p_item_price<?php echo $t ?>" type="text" value="<?php echo $row_prod[$t]['p_item_price'] ?>" size="8" maxlength="8"></td>
        <td><input name="p_item_uom<?php echo $t ?>" type="text" value="<?php echo $row_prod[$t]['p_item_uom'] ?>" size="10" maxlength="10"></td>
        <td><input name="p_item_size<?php echo $t ?>" type="text" value="<?php echo $row_prod[$t]['p_item_size'] ?>" size="10" maxlength="10"></td>
        <td><input name="p_wrap_type<?php echo $t ?>" type="text" value="<?php echo $row_prod[$t]['p_wrap_type'] ?>" size="10" maxlength="10"></td>
</tr>
<?php } // end for loop ?>
more......


So this is a 100% custom code app.

Everything is working 100% except the screen layout is "out of control". It is actually wider than the whole template and it steps "on top of" some of the other containers on the page. I can't seem to control the width of the table or the width of the individual columns in the table.

I tried adding this in my custom code but it had NO effect.
<style type="text/css">
th {
	width: 10px: !important;	
}
table {
	width: 50%: !important; 
}
</style>


I'm so close, as the function is correct, If I could ONLY get the display right. :?

Please Help,
Mr Fitz
GreyHead 13 Aug, 2013
Hi the_fitz,

The code here looks OK (assuming that you close the </table> tag somewhere. Please post a link to the listing so I can take a quick look.

Bob
the_fitz 13 Aug, 2013
Hey Bob,

Thanks for the response..
While I was waiting I realized it was the size of the INPUT fields that was messing up the display (making it too wide)
So I did this...
<style type="text/css">

table {
	
	width:80%;
}

input {
	
        width: 90px;
}
select {
	
        width: 90px;
}
</style>


And that got the inputs under control, so I'm good to go now...
Thanks again
MrFitz
This topic is locked and no more replies can be posted.