When do we use <TABLE>?

  • George L.
  • Bronze Member
  • Bronze Member
  • No Avatar
  • Joined: Nov 05, 2007
  • Posts: 2206
  • Loc: Malaysia
  • Status: Offline

Post November 9th, 2008, 2:45 am

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.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post November 9th, 2008, 2:45 am

  • Breeze
  • Photographer
  • Guru
  • User avatar
  • Joined: Apr 22, 2007
  • Posts: 1029
  • Loc: Australia
  • Status: Offline

Post November 9th, 2008, 3:10 am

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.
Photography Gallery | aaronmarc.id.au
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Joined: Dec 29, 2003
  • Posts: 5169
  • Loc: SC-USA
  • Status: Offline

Post November 9th, 2008, 3:26 am

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. ;)
- dM
  • Breeze
  • Photographer
  • Guru
  • User avatar
  • Joined: Apr 22, 2007
  • Posts: 1029
  • Loc: Australia
  • Status: Offline

Post November 9th, 2008, 3:35 am

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!
Photography Gallery | aaronmarc.id.au
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post November 9th, 2008, 4:24 am

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.
Strong with this one, the sudo is.
  • ScienceOfSpock
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Jul 06, 2004
  • Posts: 1890
  • Loc: Las Vegas
  • Status: Offline

Post November 11th, 2008, 12:22 am

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
  • No Avatar
  • Joined: Nov 05, 2007
  • Posts: 2206
  • Loc: Malaysia
  • Status: Offline

Post November 11th, 2008, 7:09 am

Thank you very much Joe, Breeze, dM and ScienceOfSpock.
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post November 12th, 2008, 4:48 am

Here's a good example <table> :D

Attachments:
table-example.gif

How the example renders.

Attachments:
table-example.html.zip

(980 Bytes) Downloaded 168 times

Strong with this one, the sudo is.
  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 09, 2008
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England
  • Status: Offline

Post November 12th, 2008, 5:36 am

Would it be an idea (a good one) to use tables for navigation?
For drop down menus?
^__^
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post November 12th, 2008, 6:28 am

I'm going to say no tastysite. I think an <ol> or <ul> is an easier to use option.
Strong with this one, the sudo is.
  • satya-prakash
  • Graduate
  • Graduate
  • User avatar
  • Joined: Oct 19, 2006
  • Posts: 134
  • Loc: Bangalore
  • Status: Offline

Post November 12th, 2008, 10:56 am

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
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post November 12th, 2008, 9:57 pm

I swapped the code out with an example attachment. :)
Strong with this one, the sudo is.
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Joined: Mar 12, 2007
  • Posts: 6228
  • Loc: South-Africa
  • Status: Offline

Post November 14th, 2008, 1:32 am

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 ...
Let's leave all our *plum* where it is and go live in the jungle ...

Post Information

  • Total Posts in this topic: 13 posts
  • Users browsing this forum: No registered users and 73 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.