Forum Moderators: open
Take this post (please..), is this an example of tabular data?
I think it is, I'm writing somthing at the moment that will have a similar style of 'user input' and think a table is the way forward but....
Because of the subject matter, I need a good definition as to why somthing like this post (and replies) are tabular data before I risk the scorn of my peers ;)
So, is it? - Do I go tables or CSS and Divs? - There are no other considerations other than using the best tool for the job.
Nick
I suppose that strictly speaking the layout of the posts here is not tabular data. I have always considered that true tabular data is data as you would see it in a spreadsheet - columns and rows and data, where each column is a different category of data type.
However (!), in a more loosely defined world you could say that (and I'm leaving out the thread title on purpose) the left column is the posters user details and the second column is the content of the post - so under that definition it could be argued as tabular data.
The best tool for the job? Depends on the requirements I suppose. I imagine that from a backend point of view a table-based layout would be easier to code that a CSS based one.
"Use CSS for all formatting. Only use tables for tabular data."
Which I think, personally, is a way to say "I'm a CSS snob" ::ducks:: but I understand their point.
My philosophy is "use CSS as much as is practical." Unless you want to be part of the revolution, which I'm not prepared to do :)
1) Less code required
2) Page loads faster
3) Cleaner code
4) Easier to update
When everything else fails - go with what's easiest. There are times when it's almost impossible to solve something without using a table. But, if it's something as "simple" as this forum - divs are (in my opinion) much easier to use.
or
<div class="userinfo"></div>
<div class="post"></div>
Save CSS for style markup such as fonts, colors, sizes, and hiding tricks. Also rollovers if you like.
But keep the structure of the page tabular.
Even though you *can* use a technology for something doesn't make it the right tool.
This forum though is increadibly simple, and will (once you get your head around the concept) be simpler in CSS DIVs structurally and syntactically then the table version.
But in the end if you'Re quick with tables and slow/cumbersome with CSS, the table will be faster and more efficient. In the end it's not a technology showcase but a site with a purpose. It's really up to you when you will take the time to learn the "new and improved tech", as always...
SN
layouts... which... are impossible in CSS
However, I'm sure someone will come and say that it is possible with absolute positioning. Though that may be true, it's also a question about usability and cross-browser compatibility.
if you're quick with tables and slow/cumbersome with CSS, the table will be faster and more efficient
Unfortunately, the HTML table model isn't that good at columns, and CSS selectors don't work well on columns, so column-related functions are not widely used.
<div class="post">
<div class="userinfo"></div>
</div>
Well, that's almost EXACTLY what I've done so far!
Looks like my first instincts were the ones to go with ;)
>snob
Yep, that's me. I'll leave the font tags to the peasants thanks...
<nick runs from the css war he's created in the mother forum>......
Seriously, thanks guys, I've been coding my arse off tonight and had all but forgotten I'd dropped this little grenade ;)
Cheers
Nick