Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2009
    Posts
    87
    Thanks
    2
    Thanked 1 Time in 1 Post

    Need help understanding table width behavior

    Code:
    <tr><td colspan="2" class="legBioTableColHeader">Legend</td></tr>
    
    <tr><td colspan="2" class="legendContents"><u>State-Level</u></td></tr>
    
    <tr>
    	<td style="background-color:white" class="legendIcon"></td>
    	<td class="legendDescription">No action.</td>
    </tr>
    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....

    Thanks.
    Last edited by jeffmatthews; 11-12-2009 at 04:50 AM.

  • #2
    Regular Coder ajetrumpet's Avatar
    Join Date
    Jul 2009
    Location
    Iowa City, IA
    Posts
    407
    Thanks
    44
    Thanked 5 Times in 5 Posts
    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.

  • #3
    New Coder
    Join Date
    Oct 2009
    Posts
    87
    Thanks
    2
    Thanked 1 Time in 1 Post
    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....

  • #4
    New Coder
    Join Date
    Oct 2009
    Posts
    87
    Thanks
    2
    Thanked 1 Time in 1 Post
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •