SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,107
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Post controlling td's content

    Hi, I have question is this normal, i have table with 5 rows and 9 columns,in my first row,some td or cell is empty I have 4 content which is longer than to other td's content.now my table look's so bad some td's are expanding some are getting smaller...how can i fixed this ?


    Thank you

  2. #2
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,805
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    that you will have to hard code into your HTML using the "colspan" attribute.

    Code:
    <tr><td>single cell></td><td colspan="2">This cell is two cols wide</td><td>single cell></td></tr>
    It really also makes sense.

    BUT if you cant alter the HTML, AND your yells are a FIXED with you could potentially use adjacent sibling selectors so assign width:


    Code:
    td , td+td+td  { width:25%}
    td+td{ width:50%}
    as you can see it's kinda clumsy. You could always add a class instead. BUT if you can do that then you might as well use my first suggestion of "colspan"

    hope that helps

  3. #3
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,107
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi, so this the fixed to put width in each td's...I tried it and it looks okay now...

    Thank you


Bookmarks

Posting Permissions

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