HTML tables
- Started
- Last post
- 36 Responses
- ukit0
Basically the idea is that every piece of markup is supposed to be appropriate to its content.
The thing is that in reality there are few elements that are all that useful for adding meaningful markup to a document. So people basically ended up using divs for everything.
HTML5 will be much different and you will end up coding something more like:
<body>
<header>
<h1>logo</h1>
</header>
<section>
<header>
<h1>section name</h1>
</header>
<p>content</p>
</section>
<footer>
copyright 2011
</footer>
</body>
- inteliboy0
"Tables are absolutely acceptable for exactly that kind of data. Nothing wrong with tables, they just got overused for page layout back in the early days of web design." Ukit. First post of this thread.
- ernexbcn0
If you don't use tables for shit that is supposed to go in a table you are not doing your job properly.
- animatedgif0
<table>
<tr>
<th>Number of years logi has been doing his job wrong</th>
</tr>
<tr>
<td>11</td>
</tr>
</table>
- kalkal0
Well after this little debate, using a screen capture of excel is sounding more and more appealing...
- hallelujah0
"he's an argumentative fool no matter what his name."
- Jaline0
CSS it shit for tabular data. Fact.
- TheBlueOne0
Semantic means "meaning" - using tables in markup imply the data in them has a particular structure/meaning in it's presentation regardless of style. Putting tabular data in divs presents the problem of it losing meaning if the style is lost.
I'm not quite sure how you can justify using divs for tabular data.
There are tons of workarounds in web design when you have to go with what works as the lesser of all evils, but this is definitely not one of them. I can't believe there are those here arguing this point.
- monNom0
^use spans with display first set to block, then to table.
- jadrian_uk0
use divs with css display:table
- vaxorcist0
I wish this religious war was over....
- ukit0
Still, the best option is always gonna be code that someone (whether human or a search engine, etc) can read and interpret without styling. Imagine someone received your HTML doc without any stylesheet, would it make more sense to use tables or divs?
If you read the HTML spec, it says to use divs as a last resort now. Only when no other element is appropriate (and in HTML5 there are so many other options you'll use them much more rarely).
- logi0
ETM, you obviously have a lack of understanding yourself. I'm 11 years into this. tabular data in divs or tables are the least of my problem, you see them more often than you know. I agree with fugged on the absurdity of the argument. All I've done is state my opinions and practices, as I had stated previously as well.
- fugged0
ffs, are we really debating if a table should be used to display tabular data?
not using a table to display tabular data is about as retarded as using a table to layout a page.
- Yes. And look at the asshats who are arguing against using them for their intended purpose.TheBlueOne
- ETM0
IMO the following demonstrates a fundamental lack of understanding:
"css gives you more control. In my work do I rarely ever make a "table" of a few rows. everything is back end fed out to hundreds if not thousands of rows so I code for end appearance."
- logi0
ETM,
in essence, at it's core, it's a row. css gives you more control. In my work do I rarely ever make a "table" of a few rows. everything is back end fed out to hundreds if not thousands of rows so I code for end appearance.
if you are going to apply a class to every column of the row for different widths or text color, why, in my opinion, deal with the inherit cross browser differences in table rendering?
skip over that issue, never look back.
my opinion/practice.also, according to my stats on personal and client sites, i can't tell if any visitor ever used a screen reader. I hope to see the one I used today in my analytics.
- *facepalmETM
- i hope you're not a professional web designer or got an education in the fieldTheBlueOne
- bliznutty0
use percentages for widths and no-wraps for readability.. this makes your table dynamic to window/screen size
- ETM0
^ But why the hell would you not use the tool CREATED for the purpose. I can't fathom how 'Don't use tables for layout' became 'Don't use tables for their proper and intended purpose.' Bloody laughable.
- I can use a butter knife to tighten a screw, but I prefer a screwdriver as it was CREATED for the purpose.
ETM
- I can use a butter knife to tighten a screw, but I prefer a screwdriver as it was CREATED for the purpose.
- logi0
TheBlueOne,
what do you mean semantic?
it validates and is properly coded, i think all you mean is "recommended practices".
the same info reads back in the same order with the same appearance.
so despite the forceful nature to push tables, the same content can be displayed with divs to the same effect as tables with no ill affects to screen reader capabilities.
- Take away your style sheet and tell us how those divs look.ETM
- Data in a table remains intact regardless of styling.ETM
- Welcome to The Semantic Web™.
Where things are marked up so because that's what they mean.
mikotondria3 - Go back to trolling with the other libertarians, apparently web design is something you don;t understandTheBlueOne