When do we use <TABLE>?

  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

I was trying out <Table></Table> to list something. I thought it was quite easy. However, I also know using CSS way of achieving the same result. So, is <table> </table> of any use?

Thanks, :)
g.
  • Breeze
  • Photographer
  • Guru
  • User avatar
  • Posts: 1029
  • Loc: Australia

Post 3+ Months Ago

I use tables rarely ... They used to be quite popular, but they've fallen out of favour and the <div> tag has fallen into it :D

I say only use <table> if you absolutely must.
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

Tables are absolutely still to be used.

You use tables when the information you're presenting is tabular in nature. For instance, accounting information often requires a tabular display.

Just think spreadsheet, not page layout. ;)
  • Breeze
  • Photographer
  • Guru
  • User avatar
  • Posts: 1029
  • Loc: Australia

Post 3+ Months Ago

digitalMedia wrote:
Tables are absolutely still to be used.

You use tables when the information you're presenting is tabular in nature. For instance, accounting information often requires a tabular display.

Just think spreadsheet, not page layout. ;)


Ah yes, my bad :D Forgot about that little thing because I don't do those little things!
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

My general rule of thumb is to use tables whenever I need more than 2 columns in a section of a page where there will be numerous rows.
With more than two columns non-table methods seem to use more markup than tables to do what tables do naturally.

My favorite example is an instance where individual columns have different background colors. Where I'd have to assign class names to a lot of elements with non-table methods, I could simply use a few <col> elements to apply styles to individual columns within a table without applying any attributes to the <td> elements.
  • ScienceOfSpock
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1893
  • Loc: Las Vegas

Post 3+ Months Ago

I've got to get my 2 cents in on this one.

First off, there is no hard and fast rule that dictates when and where tables can and cannot not be used. With the current state of web design though, tables *should* only be used for tabular data (as digitalMedia pointed out) and *should not* be used for layout.

Having said that, I must confess to using tables for layout purposes for the first 7+ years of my career, because before css, there simply was no other way. In fact, I daresay that part of the reason for the advent of CSS is the very fact that tables were being used as layout tools to create web pages with a more graphical nature than HTML was originally intended for.

HTML was originally intended as a sort of digital desktop publishing. Sort of like an electronic newspaper. Back then, because of limitations in memory, graphics and processing power, nobody envisioned that people would be building multimedia experiences with HTML, so no accommodations were made for positioning and very little were made for layout and styling. When tables were introduced (for the explicit purpose of displaying tabular data), people (including myself) discovered they could be used to layout the webpage and position graphics, and so that's what they were repurposed to do.

Then CSS was introduced and, for the most part, it addressed the positioning, layout and style aspects of HTML.

Now that css is fairly mature, there really is no reason to use tables for design or layout. There are a very few rare occasions, where CSS parsing in different browsers renders results that are different enough to force some developers to revert back to tables for layout, but in general, tables should be used for tabular data only. That's the way I do it, and that's the way I recommend doing it.

On a personal level, I really don't care whether a site that I'm visiting is using tables or css for their layout/design, and I rarely check, but you will run into zealots on both sides. Until something is done by the w3c to eliminate tables-as-positional-aids or to force css as the only method of layout/design, it's really up to the programmer/designer, and there will always be discussions about it.
  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

Thank you very much Joe, Breeze, dM and ScienceOfSpock.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

Here's a good example <table> :D

Attachments:
table-example.gif

How the example renders.

Attachments:
table-example.html.zip

(980 Bytes) Downloaded 205 times

  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

Would it be an idea (a good one) to use tables for navigation?
For drop down menus?
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

I'm going to say no tastysite. I think an <ol> or <ul> is an easier to use option.
  • satya-prakash
  • Graduate
  • Graduate
  • User avatar
  • Posts: 134
  • Loc: Bangalore

Post 3+ Months Ago

Oh! Jeobert please help!

I tried to check you table example. You used colgroup etc.

but I have found it very problematic to use code from here. It should not be.
Line number comes to clipboard even after I used line no off. I also tried to use "select all" and then copy.

What do you think? Is there should be a future to copy code easily from here! I think simple solution would be to give a copy link and remove line info in between.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

I swapped the code out with an example attachment. :)
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

The line numbers should only show when using FireFox ... just for this example, copy the url, and paste it in IE or Opera or something else and then copy the code ...

Post Information

  • Total Posts in this topic: 13 posts
  • Users browsing this forum: No registered users and 50 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.