1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

<div> vs <td>

Discussion in 'HTML & Website Design' started by ghyper.com, Jun 7, 2010.

  1. kids

    kids Active Member

    Messages:
    411
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    68
    #41
    Sometime DIV and sometime TABLE, but DIV will be better and more complexer because sometime float made you mad ke ke
     
    kids, Jun 27, 2010 IP
  2. khucthuydu

    khucthuydu Member

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #42
    i use div for web, td for test
     
    khucthuydu, Jun 27, 2010 IP
  3. wpg56

    wpg56 Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #43
    Used properly <divs> can be used , the <table><td> are old coding and should be considered depreciated. Anything previously done in a <td> can be done with a <div>
     
    wpg56, Jul 2, 2010 IP
  4. Mattingley

    Mattingley Greenhorn

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    8
    #44
    I agree, using tables for layout coding is pre 2000s
     
    Mattingley, Apr 22, 2015 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #45
    Wow, nice bump of a five year old thread, though it's a laugh the halfwit responses showing just how many people never quite grasp how to use HTML properly, or why all these tags exist.

    TABLES are for TABULAR DATA, if the rows and columns have a semantic relationship (like a row of fields) that's what TABLE, THEAD, TBODY, TR, TH (with SCOPE) and TD are FOR. They are NOT deprecated, they should NOT be considered deprecated, they serve a legitimate purpose, USE IT when you actually have tabular data like a spreadsheet, or a list of forum posts that have information. For example there is NOTHING wrong with:

    <table id="forumPosts">
    	<caption>General Ranting</caption>
    	<thead>
    		<tr>
    			<th scope="col">Topic</th>
    			<th scope="col">Replies</th>
    			<th scope="col">Last Post</th>
    		</tr>
    	</thead><tbody>
    		<tr>
    			<th scope="row">Bounce of five year old thread</th>
    			<td>26</td>
    			<td>Today at 21:00 by Deathshadow</td>
    		</tr><tr>
    			<th scope="row">Some other thread</th>
    			<td>1</td>
    			<td>20 April 2015 by SomeUser</td>
    		</tr>
    	</tbody>
    </table>
    Code (markup):
    Stuff like that is what tables are FOR! You just shouldn't be using them JUST because you want columns -- there should be a relationship established to justify it's use (said relationship maintained by the use of headings and scope!). If there is no semantic relationship between the columns and rows, don't use a table. THAT's when it becomes "tables for layout" and pointless code bloat. If you are only going to have one TR, you probably shouldn't have a table. If you are only having one TD or TH inside your TR, there is NO reason to be using a table. If there is no semantic relationship between the rows (like them being a related row of data) or semantic relationship between your columns (being all the same type of data) then there is NO reason to be using a table. That's why this:

    <table id="columns">
    	<tr>
    		<td class="leftColumn">
    			<h2>Sidebar</h2>
    			<p>
    				Whatever goes in the sidebar
    			</p>
    		</td><td class="rightColumn">
    			<h2>Content</h2>
    			<p>
    				Your actual page content goes here
    			</p>
    		</td>
    	</tr>
    </table>
    Code (markup):
    Is halfwit nonsense and exactly what the people who know what they are talking about mean by "tables for nothing" or "tables for layout".

    Hence why the dipshits abusing nested lists and other tags to format obviously tabular data are, well... so full of manure you'd think they were Biff Tannen's 1946 Ford Super De Luxe Convertible.

    DIV are semantically neutral, they simply say "this section may receive styling" without saying what that styling IS. That's why when you create your semantic markup (which should be done LONG before you even THINK about layout) you should have no DIV or SPAN. (span just being an inline-level DIV). You add DIV during the styling process when and only when needed as you've exhausted what you can do to the existing semantic tags.

    It's funny because there are a whole slew of reasons NOT to waste tables on things, but there are legitimate reasons to use them too; there's NO reason to just start making shit up about them out of ignorance or blindly parroting things said by people who never quite grasped the point of HTML in the first place! DIV are for grouping tags for the application of style without saying what that style is. TABLE and it's associated tags are for saying "this is tabular data with a semantic relationship" which is why abusing them just to make columns is bad.

    In a lot of ways it's like the mouth-breathing halfwits who are STILL convinced STRONG and EM are replacements for B and I, which is also ignorant nonsense; one is not putting "more emphasis" on an organization's name or "emphasis" on a book title. JUST because a tag has a certain appearance does NOT mean that's what the tag MEANS.

    Or as I keep saying, if you are choosing your tags based on their default appearance, you are choosing all the wrong tags for all the wrong reasons.
     
    deathshadow, Apr 22, 2015 IP
  6. jackburd

    jackburd Active Member

    Messages:
    396
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #46
    It's 2015, you better ask, which should work better? <div> , <header>, <aside>, <footer> ?

    just use <td> for table.

    -END-
     
    jackburd, May 12, 2015 IP
  7. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #47
    Assuming once you've learned what numbered headings and horizontal rules are for that you could possibly be DUMB enough to believe that the ALLEGEDLY semantic HTML 5 structural tags serve any legitimate purpose other than code bloat and pointless redundancies.

    But who am I to argue with a specification designed to drive site development back to the WORST of pre-strict development practices by legitimizing ideas that have no damned business in a markup language in the first place!
     
    deathshadow, May 12, 2015 IP
  8. KewL

    KewL Well-Known Member

    Messages:
    245
    Likes Received:
    16
    Best Answers:
    3
    Trophy Points:
    128
    #48
    Can't believe people are still talking about this in 2015!! Let alone 2010 hahah
     
    KewL, May 14, 2015 IP
    deathshadow likes this.
  9. thejohnny

    thejohnny Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #49
    use divs :) TD is the way, old table based websites. Very 1999 :)
     
    thejohnny, May 19, 2015 IP