View Full Version : Need help understanding table width behavior

Nov 12th, 2009, 05:46 AM
<tr><td colspan="2" class="legBioTableColHeader">Legend</td></tr>

<tr><td colspan="2" class="legendContents"><u>State-Level</u></td></tr>

<td style="background-color:white" class="legendIcon"></td>
<td class="legendDescription">No action.</td>

I am trying to make the 3rd row, 1st column have a width of 12px. I want the 2nd column in that row to take up the rest of the table width.

I have tried playing with setting width, min-width and max-width between these two columns, and it seems in every case that the 2nd column just ignores everything and sets itself to be some arbitrary width. The 1st column acts the same way.

What is the pattern by which these tags behave such that I can accomplish my goal? I'd sure to like understand this, set it, and move on....


Nov 12th, 2009, 06:03 AM
set the width of one column to 12, fixed width, then the other column to the remainder of the width. check the table properties to find out how wide the whole thing is. Or...do percentages instead of pixels.

also, I don't think you can have different column widths for different rows in the same table.

Nov 12th, 2009, 06:06 AM
I am not having different column widths. The first 2 rows span 2 columns, and I would think they don't need to know they column width at that point.

The rest of the rows, I want to have first column 12 px, and 2nd column, the remainder of table width.

Somehow, I think my colspans at the top are messing this up....

Nov 12th, 2009, 06:15 AM
Got it! I found a blog that said to make sure that all columns of the first row are explicitly set and that the sum of all widths needs to equal the table width.