473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 2251
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

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

Similar topics

0
by: Robert Wille | last post by:
I have a number of very common queries that the optimizer plans a very inefficient plan for. I am using postgres 7.2.3. I vacuum hourly. I'm wonderingwhat I can do to make the queries faster. Here...
1
by: Robert Wille | last post by:
I have a number of very common queries that the optimizer plans a very inefficient plan for. I am using postgres 7.2.3. I vacuum hourly. I'm wonderingwhat I can do to make the queries faster. Here...
5
by: nimdez | last post by:
Hi, I am working on an existing code base in which a lot of data displayed to the user is formatted in tables. Most tables are printed row-by-row using printf() with "%s" print conversion...
6
by: SkeanDu | last post by:
Ok, here is my problem. I have an aspx page that displays a databound datagrid and in one of the datagrid column headers I have an image that when clicked opens up a modal web dialog (another...
0
by: cedoucette | last post by:
I just wrote code to support sortable columns in a datagrid. It seems to work fine; but, it doesn't look right. The problem is that I have a generic style for links and a different style for the...
17
by: Mike Fellows | last post by:
im trying (unsucessfully) to add a checkbox column to my datagrid i basically have a datagrid that im populating from a dataset Me.DataGrid1.DataSource = ds.Tables(0) the datagrid then has 5...
2
by: Charleees | last post by:
Hi all, I have a DataGrid with Template Columns..... There are LAbels,Linkbuttons in the Single Row.. I have to set the Constant Column width for those Template Columns in Grid... Wat...
2
by: Bob | last post by:
Hi, How can I force a listview to have only one column so that it resembles a listbox? Thanks, Bob
1
by: =?Utf-8?B?Z3V5?= | last post by:
I have a GridView with column widths defined as percentages however if a column has a row that is longer than the defined width the column width increases to compensate. If I turn Wrap on this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.