Would you use tables?

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
QbertsBrother
Forum Commoner
Posts: 58
Joined: Thu Oct 11, 2007 10:12 am

Would you use tables?

Post by QbertsBrother »

i am working on a web based application that i created. it has a lot of forms and reports.

i read other places that tables are best for reports and forms.

should i use tables to display the reports and such? i have changed one report to tables and let me tell you it lays out better and it prints way better.

should i convert all my other reports to tables?

any advise will be much appreciated.

thanks
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: Would you use tables?

Post by kaszu »

Tables are for tabular data, if your report is tabular data, then yes.
I don't agree that it should be used for forms. For forms use elements, which are meant for forms: 'form', 'fieldset', 'label', 'input', etc.

See nor0101 comment viewtopic.php?f=13&t=94029#p514093, it's about lists, but the idea is the same.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Would you use tables?

Post by califdon »

Ask a dozen web designers and you will get 13 answers. It is true that HTML tables were intended for displaying tabular data and many people argue strongly that they should never be used just for positioning. I believe that's a good principle, but I must say that I have found many situations where it is far easier to use an HTML table to position elements that will be consistently displayed in all browsers, than it would be to work out all the <div> styles to achieve the desired result, even in one browser, then sometimes other browsers will not be identical. So my conclusion is that you should be guided by what works for your project. I do believe that design principles are important, and every web designer should learn the "proper" methods to use, but if it comes down to creating a web page with Tables in an hour or spending 3 days trying to get the <div>s to produce the same result, I know what I would do.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: Would you use tables?

Post by jayshields »

It depends what type of project it is too. For example, people argue that tables should only be used for tabular data (not forms and layouts) partly because of semantics. Having semantic markup gives screen readers an easier job when looking at source code. If you're not bothered about the source code, then that's one reason why you should just use tables if they're easier for you to implement.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Would you use tables?

Post by Chris Corbyn »

A lot of places I would have used tables in HTML 4, I now decide between the following possible semantic routes:

1. Use a table... it might be the correct thing to use
2. Use a definition list (<dl>), I find I'm using these a lot

I'm sure I use other elements for presenting information, but tables and definition lists spring to mind. I certainly don't avoid using tables, I just don't use them for making layouts (not even sure I'd remember all that crazy colspan & rowspan logic :P).

And yes, for forms you should use a combination of fieldset and label elements, which of course can be nested. Even the default behaviour for these elements is usually close to what you want.
QbertsBrother
Forum Commoner
Posts: 58
Joined: Thu Oct 11, 2007 10:12 am

Re: Would you use tables?

Post by QbertsBrother »

thanks for all the info but what would one consider "tabular data"?

would my reports be considered tabular data? my reports consist of one line per record from the database that i have used a table to display correctly. i was able to get the layout using div's but i had problems with the printing.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: Would you use tables?

Post by jayshields »

Tabular data is generally considered quantitative, but generally tabular stuff is anything that is easier to read when put in a table.

If you're just dumping a resultset or whole database table, then a table is probably a good idea.
User avatar
Skoalbasher
Forum Contributor
Posts: 147
Joined: Thu Feb 07, 2008 8:09 pm

Re: Would you use tables?

Post by Skoalbasher »

Following this thread topic...

What do you mean tables shouldn't be used for forms? For semantic reasons? Not really understanding what you mean there. Aren't tables WAY easier to make look good? I don't know how I could make a layout look nice without tables.

What other way is there?
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Would you use tables?

Post by papa »

Skoalbasher wrote:Following this thread topic...

What do you mean tables shouldn't be used for forms? For semantic reasons? Not really understanding what you mean there. Aren't tables WAY easier to make look good? I don't know how I could make a layout look nice without tables.

What other way is there?
Style with CSS using div tags, ul, li etc.

I also prefer tables but it's just something you have to learn.
User avatar
Skoalbasher
Forum Contributor
Posts: 147
Joined: Thu Feb 07, 2008 8:09 pm

Re: Would you use tables?

Post by Skoalbasher »

papa wrote:
Skoalbasher wrote:Following this thread topic...

What do you mean tables shouldn't be used for forms? For semantic reasons? Not really understanding what you mean there. Aren't tables WAY easier to make look good? I don't know how I could make a layout look nice without tables.

What other way is there?
Style with CSS using div tags, ul, li etc.

I also prefer tables but it's just something you have to learn.
Oh I gotcha, I'm kinda learning CSS on the side. But i'm using it to.. manipulate tables. haha!

Can you get the same effects you can with a table using CSS?
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: Would you use tables?

Post by jayshields »

Skoalbasher wrote:Can you get the same effects you can with a table using CSS?
Yes, it's probably the most widely talked about topic in Web Design!
mickeyunderscore
Forum Contributor
Posts: 129
Joined: Sat Jan 31, 2009 9:00 am
Location: UK

Re: Would you use tables?

Post by mickeyunderscore »

I use tables for laying out reports, I find they are easier for laying out information like that. I use them for HTML forms too.

Don't worry too much about the CSS vs table debate as it is generally focused around entire sites layed out in deeply nested tables, not around a few reports set out in tables.
Post Reply