Difference between <TD> & <TH> Tags (Dreamweaver)

Discussion in 'HTML & Website Design' started by AdrianMoss, Feb 19, 2009.

  1. #1
    I have a basic website built via dreamweaver with tables. I asked InfoLinks if my site was compatible with their service (I use it on some of my other websites) and after some back & forth emails they told me I need to change the <TH> tags to <TD> tags.

    I looked at my code and it looks like I have both <TH> & <TD> Tags.

    I looked up the definition of <TD> & <TH> Tags and from what I can gather it looks like <TH> refers to the Table Header and <TD> refers to the Table Data.

    Does anyone know if I can just go through and change all the <TH> tags to <TD> tags without running into any problems?
     
    AdrianMoss, Feb 19, 2009 IP
  2. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You are right TH is for the Table Header,
    TD is like a CELL inside a table.

    It depends on what you are using your TH tags for, you can change them to TD tags for sure and get them to span accross if this is what the TH were doing.

    Of course it's better to not use tables at all for your layout!
     
    wd_2k6, Feb 19, 2009 IP
  3. AdrianMoss

    AdrianMoss Active Member

    Messages:
    159
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    What do you use for your layout?
     
    AdrianMoss, Feb 19, 2009 IP
  4. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Mainly DIV's and use of CSS to control the presentation. So a typical layout for a page would be:

    
    <div id="header">Header Goes Here Usually includes a menu and a logo</div>
    <div id="content">Main Content Goes Here May contain more than 1 DIV if more than 1 column</div>
    <div id="footer">Footer Goes Here</div>
    
    Code (markup):
    And to develop that further a simple 1 column page:

    
    <div id="header">
        <img src="logo.jpg" />
        <ul id="menu">
           <li><a href="link1.htm">LINK 1 </a></li>
           <li><a href="link2.htm">LINK 2 </a></li>
           <li><a href="link3.htm">LINK 3 </a></li>
        </ul>
    </div>
    <div id="content">Main Content Goes Here May contain more than 1 DIV if more than 1 column</div>
    <div id="footer">© All Rights Reserved 2009</div>
    
    Code (markup):
    Then you can use CSS to refer to individual elements and alter the presentation, meaning backgrounds borders gaps colours hover colours etc.. basically present things how you want.
     
    wd_2k6, Feb 19, 2009 IP
  5. matiskater

    matiskater Peon

    Messages:
    113
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    td goes inside th am i right?
     
    matiskater, Feb 19, 2009 IP
  6. SiteTalkZone

    SiteTalkZone Peon

    Messages:
    243
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    No,

    TH is table header cells, by defult i think the text is centered where in TD it's left. Of course you can use CSS to style the different types of cell.

    <table>
    <tr><th>Table Header!!</th></tr>
    <tr><td>Table Cell</td></tr>
    </table>
     
    SiteTalkZone, Feb 20, 2009 IP