473,786 Members | 2,775 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 2273
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
1608
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 container that owns it */ name varchar(120) not null, /* Its name */ state bigint not null default 0,...
1
2793
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 container that owns it */ name varchar(120) not null, /* Its name */ state bigint not null default 0,...
5
5298
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, it overflows the column and takes the table out of alignment. What I want it to do is word-wrap...
6
2438
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 dialog that will then disappear and the filtered data will be displayed on my datagrid.
0
2624
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". Can anyone tell me how to get consistent styles for each column in my datagrid header?
17
7438
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
10406
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
25587
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
4729
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 address? The GridView is not editable.
0
9650
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9962
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8992
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7515
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4067
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
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.