Forum Moderators: open

Message Too Old, No Replies

tables for tabular data

seperating structure from presentation

         

fwordboy

10:23 am on May 26, 2004 (gmt 0)

10+ Year Member



this is not a question regarding css-p vs table based design but merely a question about when using tables for tabular data and which attributes should be used in the css and which should be expressed in the html. e.g.
which is better

<table width="80%" cellpadding="2">
<tr>
<td width="250px">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

or

<table id="maths">
<tr>
<td class="fat">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

linked to

#maths{
width: 80%;
}

#maths td{
padding: 2px;
}

.fat{
width: 250px;

}

if style and content are to be seperated then surely the latter is correct, yet more more laborious.

ronin

11:32 am on May 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The latter looks more correct to me, personally.

Arguably less laborious too, especially if you have similar tables across ten or so pages and at a later date you want to shrink the tables from 80% to 72%.

Purple Martin

5:54 am on May 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What Ronin said.
Also...
You'll find in the future that changing to XHTML will be much easier if you do it the second way.