Css for TD "top align" and not center

Discussion in 'CSS' started by fortunegeek, Dec 6, 2008.

  1. #1
    I have a webpage that is pulling .tpl files from php... there are three columns and the first two are fine.. the last one centers from the middle instead of the top... what is the css command i need to get the third <td> column to start at the top of the page?

    Hope i explained that clearly....

    This is currently what i have.. or you can see the live page in my sig...

    <td><table width="100%" class="content directories menulist" style="padding:0px; padding-top:2px;">
    
    <tr><td class="content1" >
    <table><tr><td>
      <table width="175px" class="content directories">
    <tr><td class="titlebar">Title Bar</td></tr>
    
    Code (markup):

     
    fortunegeek, Dec 6, 2008 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    +<td class="content1" valign="top" style="padding: 2px 0px 0px;">
    </td>
    +<td valign="top" align="center" style="padding: 2px 5px 5px;">
    </td>
    +<td>
    </td>
    Code (markup):
    + indicates source is collapsed.

    You have that deprecated "valign" attribute on the first two tds. Since the coding's already crap, add it to the third.

    A better solution is to remove the attribute from all, and use css, td {vertical-align:top;}

    cheers,

    gary
     
    kk5st, Dec 6, 2008 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #3
    Mirrors my thoughts too. I'm not seeing anything on that page that warrants a table for layout, even IF you used a table for layout there's no need for more than one... You seem to be nesting table inside table inside table for absolutely no good reason. I see invalid values passed to a width attribute, presentational classnames, multiple UL's for single items, nothing resembling semantic markup, and of course outdated transitional markup.

    Even classic blunders like <td class="titlebar"> - after all isn't that what a TH or CAPTION is for?

    Really needs to be chucked at started over clean. 40k of markup for 5k of content is a sure sign of outdated old-fashioned bloated HTML.
     
    deathshadow, Dec 7, 2008 IP
  4. fortunegeek

    fortunegeek Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Part of the problem with this page.. is all the little "modules" are indiviudally loaded template files... the code is not in one area its in like 50 pages... its a ton of work to get it to clean css... hence.. i just want it validating at this point... :)

    which it does...

    thoughts appreciated though :)
     
    fortunegeek, Dec 8, 2008 IP