Page 1 of 1
Would you use tables?
Posted: Sat Jan 24, 2009 12:00 am
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
Re: Would you use tables?
Posted: Sun Jan 25, 2009 12:29 pm
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.
Re: Would you use tables?
Posted: Sun Jan 25, 2009 12:56 pm
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.
Re: Would you use tables?
Posted: Sun Jan 25, 2009 3:39 pm
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.
Re: Would you use tables?
Posted: Mon Jan 26, 2009 4:57 am
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

).
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.
Re: Would you use tables?
Posted: Mon Jan 26, 2009 10:17 am
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.
Re: Would you use tables?
Posted: Mon Jan 26, 2009 2:19 pm
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.
Re: Would you use tables?
Posted: Wed Feb 04, 2009 9:19 am
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?
Re: Would you use tables?
Posted: Wed Feb 04, 2009 9:31 am
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.
Re: Would you use tables?
Posted: Wed Feb 04, 2009 10:30 am
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?
Re: Would you use tables?
Posted: Wed Feb 04, 2009 10:44 am
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!
Re: Would you use tables?
Posted: Wed Feb 04, 2009 2:06 pm
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.