473,547 Members | 2,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forcing Column Width

4 New Member
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:12 0px', 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_purch ase.php'>New Purchase</a></td>
<td><a href='manage_lo cations.php'>Ma nage Purchase Locations</a></td>
<td><a href='manage_pa rt_types.php'>M anage Part Types</a></td>
<td><a href='storage_l ocations.php'>M anage Storage Locations</a></td>
</tr>
</table>

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

<p class='header'> Insert New Purchase</p>
<form action='new_pur chase.php' name='mainForm' method='post'>
<table style='align:ce nter; border:0'>
<tr>
<td colspan='3'>
Purchase Date
</td>
<td colspan='8'>
<input type='text' value='2007-11-14' name='pur_date' onchange='magic Date(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_lo cations.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_n um' />
</td> </tr>
<tr>
<td colspan='3'>
Item Count
</td>
<td colspan='8'>
<input type='text' size='2' value='2' onchange='submi tRows()' name='item_coun t' id='item_count' />
<input type='hidden' name='changeRow s' 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='ascend ingId()' onmouseover='hl ight(this)' onmouseout='uli ght(this)'>ID</td>
<td class='textbc'> Ver</td>
<td class='textbc'> VIN</td>
<td class='textbc'> Type <a href='manage_pa rt_types.php' target='_blank' >Manage</a></td>

<td class='textbc'> Storage <a href='storage_l ocations.php' target='_blank' >Manage</a></td>
<td class='textbc'> Lbs</td>
<td class='textbc'> Oz</td>
<td class='textbr' style='width:12 0px'>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='1FMDU73E 74ZB21160' />
</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='setFiel ds(); numFormat(this) ' size='3' class='textr' name='price[]' value='1' />

</td>
<td class='textr'>
$<span name='env_fee_d isp'>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_tota l_disp'>0.00</span><input type='hidden' size='3' class='textr' name='item_tota l[]' 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='setFiel ds(); numFormat(this) ' size='3' class='textr' name='price[]' value='0.00' />
</td>
<td class='textr'>
$<span name='env_fee_d isp'>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_tota l_disp'>0.00</span><input type='hidden' size='3' class='textr' name='item_tota l[]' 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'>Sub total</td>
<td colspan='4'></td>
<td class='textr'>$ <span id='subtotal'>0 .00</span></td>
</tr>

<tr>
<td colspan='3'>Env ironmental Fee</td>
<td colspan='5'></td>
<td class='textr'>$ <input class='textr' style='backgrou nd: #B1B1B1' onfocus='change White(this)' onblur='setFiel ds(); numFormat(this) ; backToGrey(this )' type='text' size='3' id='env_fee' name='env_fee_t otal' value='1' /></span></td>
</tr>
<tr>
<td colspan='3'>Sal es Tax</td>

<td colspan='6'></td>
<td class='textr'>$ <input class='textr' type='text' style='backgrou nd: #B1B1B1' onfocus='change White(this)' onblur='setFiel ds(); numFormat(this) ; backToGrey(this )' size='3' id='sales_tax' name='sales_tax _total' value='34' /></span></td>
</tr>
<tr>
<td colspan='3'>Tot al</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 2263
robin1983
99 New Member
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 New Member
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
1591
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 are the relevant tables: create table image( imageid integer not null, /* The image's ID */ containerid integer not null, /* The...
1
2758
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 are the relevant tables: create table image( imageid integer not null, /* The image's ID */ containerid integer not null, /* The...
5
5284
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 specification for each column (e.g. printf(%10s %25s %15s\n", pszCol1, pszCol2, pszCol3)). My problem is that when a string is longer the column's width,...
6
2427
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 aspx page). >From this dialog I want the users to be able to select a filter item from a databound combobox and click on the apply button on the web...
0
2613
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 header row - and they conflict. The sortable column apparently uses the generic style for <a> elements and the rest of the header uses "headerRow". ...
17
7415
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 columns in it but i need to add a sixth column which will be my checkbox column - any help or pointers with this would be great
2
10383
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 actually happens is... when the Text size is too big... the column
2
25526
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
4719
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 works but only if there are spaces in the text. How can I force wrapping (or scrolling) ft the text is is too long for the box? e.g. a long email...
0
7437
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7703
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7797
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3473
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1923
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1050
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.