Computing.Net > Forums > Web Development > Table Column Width Problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Table Column Width Problem

Reply to Message Icon

Name: mcclausky
Date: March 1, 2008 at 13:02:46 Pacific
OS: Windows XP Pro
CPU/Ram: 1 GB
Comment:

Hello,

I'm having the same problem as the one described here:

http://www.computing.net/webdevel/w...

The problem is that this setting:

<th style="width:300px;">This is the header<th>

works ONLY if the table width is less than the width of the screen. If I add several columns, the settings do not take effect, and the columns width size themselves.

The link shown above describes a previous solution setting the whole table width, but in my case I need a solution WITHOUT setting the table width. This table will be dynamically generated and it will have several columns, so I need to set a fixed width for some columns.

Your help will be appreciated .

Mc



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: March 1, 2008 at 22:33:38 Pacific
Reply:

I'm assuming that the rows are shrinking when the table is bigger than the window. This makes sense since it would be better to show the content than to push it off the page in most instances.

One way you can force the columns not to shrink would be to create a spacer row. First create a 1 pixel transparent gif. Then create a row at the beginning or end of the table and put this image in each cell and give it the width of the row.


<td style="width:300px;">[img src="trans.gif" style="width:300px;height:1px;" /]<td>


Michael J


0

Response Number 2
Name: mcclausky
Date: March 2, 2008 at 07:47:09 Pacific
Reply:

Michael:

Thanks a lot, that did the trick for me!

Mc


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Table Column Width Problem

Table Column Width Problem www.computing.net/answers/webdevel/table-column-width-problem/2865.html

IE table column width problem www.computing.net/answers/webdevel/ie-table-column-width-problem/3531.html

[HTML] Setting table td width? www.computing.net/answers/webdevel/html-setting-table-td-width/3105.html