471,624 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,624 software developers and data experts.

Forcing Column Width

4
Hi,

I have been having some trouble with getting a column to be a fixed width. I have a table with 11 columns, so it doesn't all fit in a normal browser window. One of the cells has a "?" and then a text input, but because the table keeps minimizing the width of the column, it puts the ? and the text input on different lines, creating a row that is much taller than I would prefer, and it just looks gross. I have set the width using style='width:120px', but for some reason firefox keeps minimizing the cell width to the bare minimum to prevent clipping.

Here is the code (Line 73 is where I specify the width of the column I want to be 120px wide):

[HTML]<table width='100%' border='0' class='textc'>

<tr>
<td><a href='new_purchase.php'>New Purchase</a></td>
<td><a href='manage_locations.php'>Manage Purchase Locations</a></td>
<td><a href='manage_part_types.php'>Manage Part Types</a></td>
<td><a href='storage_locations.php'>Manage Storage Locations</a></td>
</tr>
</table>

<hr size='2' width='100%' color='#000066' />

<p class='header'>Insert New Purchase</p>
<form action='new_purchase.php' name='mainForm' method='post'>
<table style='align:center; border:0'>
<tr>
<td colspan='3'>
Purchase Date
</td>
<td colspan='8'>
<input type='text' value='2007-11-14' name='pur_date' onchange='magicDate(this)' />

</td>
</tr>
<tr>
<td colspan='3'>
Purchase Location
</td>
<td colspan='8'>
<select name='pur_loc'>
<option value='0'></option>
</select> <a href='manage_locations.php' target='_blank'>Manage</a>
</td>
</tr>
<tr>
<td colspan='3'>
Receipt Number
</td>
<td colspan='8'>

<input type='text' size='2' value='1' name='receipt_num' />
</td> </tr>
<tr>
<td colspan='3'>
Item Count
</td>
<td colspan='8'>
<input type='text' size='2' value='2' onchange='submitRows()' name='item_count' id='item_count' />
<input type='hidden' name='changeRows' id='changeRows' value='0' />

</td>
</tr>
<tr>
<td colspan='11'>
<hr width='100%' size='1' color='#000066' />
</td>
</tr>
<tr>
<td class='textbc' colspan='11'>

Line Items
</td>
</tr>
<tr>
<td class='textbc' onclick='ascendingId()' onmouseover='hlight(this)' onmouseout='ulight(this)'>ID</td>
<td class='textbc'>Ver</td>
<td class='textbc'>VIN</td>
<td class='textbc'>Type <a href='manage_part_types.php' target='_blank'>Manage</a></td>

<td class='textbc'>Storage <a href='storage_locations.php' target='_blank'>Manage</a></td>
<td class='textbc'>Lbs</td>
<td class='textbc'>Oz</td>
<td class='textbr' style='width:120px'>Price</td>
<td class='textbr'>EnvFee</td>
<td class='textbr'>Tax</td>

<td class='textbr'>Total</td>
</tr>
<tr>
<td>
<input type='text' size='2' name='record_id[]' value='1' />
</td>
<td>
<input type='text' size='2' name='version[]' value='1' />

</td>
<td>
<input type='text' size='24' onkeyup='getVIN(this,0)' name='VIN[]' value='1FMDU73E74ZB21160' />
</td>
<td>
<select name='type[]'>
<option value='0'></option>
</select>
</td>
<td>
<select name='stor[]'>
<option value='0'></option>
<option value='1' selected>Lilly Pulitzer Box</option>
</select>
</td>

<td>
<input type='text' size='2' name='lbs[]' value='1' />
</td>
<td>
<input type='text' size='2' name='oz[]' value='4' />
</td>
<td>
$<input type='text' onblur='setFields(); numFormat(this)' size='3' class='textr' name='price[]' value='1' />

</td>
<td class='textr'>
$<span name='env_fee_disp'>0.00</span><input type='hidden' size='3' class='textr' name='env_fee[]' value='' />
</td>
<td class='textr'>
$<span name='sales_tax_disp'>0.00</span><input type='hidden' size='3' class='textr' name='sales_tax[]' value='' />
</td>

<td class='textr'>
$<span name='item_total_disp'>0.00</span><input type='hidden' size='3' class='textr' name='item_total[]' value='' />
</td>
</tr>
<tr>
<td colspan='11' class='textc'>
<input type='text' name='year[]' size='3' readonly class='form' value='2004' />
<input type='text' name='make[]' size='20' readonly class='form' value='FORD' />

<input type='text' name='model[]' size='30' readonly class='form' value='EXPLORER XLT/XLT SPT/NBX' />
<input type='text' name='body[]' size='30' readonly class='form' value='4 DR. WAGON/SPORT UTILITY' />
<input type='text' name='engine[]' size='30' readonly class='form' value='4.0L V6 FI SOHC' />
</td>
</tr>
<tr>
<td colspan='11'>
<hr width='100%' size='1' color='CCCCCC' />
</td>

</tr>
<tr>
<td>
<input type='text' size='2' name='record_id[]' value='' />
</td>
<td>
<input type='text' size='2' name='version[]' value='' />
</td>
<td>

<input type='text' size='24' onkeyup='getVIN(this,1)' name='VIN[]' value='' />
</td>
<td>
<select name='type[]'>
<option value='0'></option>
</select>
</td>
<td>

<select name='stor[]'>
<option value='0'></option>
</select>
</td>
<td>
<input type='text' size='2' name='lbs[]' value='' />
</td>

<td>
<input type='text' size='2' name='oz[]' value='' />
</td>
<td>
$<input type='text' onblur='setFields(); numFormat(this)' size='3' class='textr' name='price[]' value='0.00' />
</td>
<td class='textr'>
$<span name='env_fee_disp'>0.00</span><input type='hidden' size='3' class='textr' name='env_fee[]' value='' />

</td>
<td class='textr'>
$<span name='sales_tax_disp'>0.00</span><input type='hidden' size='3' class='textr' name='sales_tax[]' value='' />
</td>
<td class='textr'>
$<span name='item_total_disp'>0.00</span><input type='hidden' size='3' class='textr' name='item_total[]' value='' />
</td>

</tr>
<tr>
<td colspan='11' class='textc'>
<input type='text' name='year[]' size='3' readonly class='form' value='' />
<input type='text' name='make[]' size='20' readonly class='form' value='' />
<input type='text' name='model[]' size='30' readonly class='form' value='' />
<input type='text' name='body[]' size='30' readonly class='form' value='' />
<input type='text' name='engine[]' size='30' readonly class='form' value='' />
</td>

</tr>
<tr>
<td colspan='11'>
<hr width='100%' size='1' color='CCCCCC' />
</td>
</tr>
<tr>
<td colspan='11'>
<hr width='100%' size='1' color='#000066' />

</td>
</tr>
<tr>
<td colspan='3'>Subtotal</td>
<td colspan='4'></td>
<td class='textr'>$<span id='subtotal'>0.00</span></td>
</tr>

<tr>
<td colspan='3'>Environmental Fee</td>
<td colspan='5'></td>
<td class='textr'>$<input class='textr' style='background: #B1B1B1' onfocus='changeWhite(this)' onblur='setFields(); numFormat(this); backToGrey(this)' type='text' size='3' id='env_fee' name='env_fee_total' value='1' /></span></td>
</tr>
<tr>
<td colspan='3'>Sales Tax</td>

<td colspan='6'></td>
<td class='textr'>$<input class='textr' type='text' style='background: #B1B1B1' onfocus='changeWhite(this)' onblur='setFields(); numFormat(this); backToGrey(this)' size='3' id='sales_tax' name='sales_tax_total' value='34' /></span></td>
</tr>
<tr>
<td colspan='3'>Total</td>
<td colspan='7'></td>
<td class='textr' width='65px' >$<span id='total'>0.00</span></td>

</tr>
</table>[/HTML]

Any suggestions?

Thanks in advance,

Christian
Nov 14 '07 #1
2 2149
Hi, just do one more thing, do give the css code too, i mean those class that u call up. ok then i hope i can help u . thanks
Nov 15 '07 #2
xtian
4
I think I got it after tons of fighting and struggling, but thanks.

xtian
Nov 21 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Robert Wille | last post: by
1 post views Thread by Robert Wille | last post: by
17 posts views Thread by Mike Fellows | last post: by
2 posts views Thread by Bob | last post: by
1 post views Thread by =?Utf-8?B?Z3V5?= | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.