![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
More to the point, is this actually an abuse of tables? I read a thread here a while back in which someone suggested that this was reasonable. It was suggested that this was a form of tabular data. No-one argued with that, and it seemed a fair suggestion. |
#3
| |||
| |||
|
|
I understand the issue that tables should be used for tabular data and not for layout, but I would like some clarification as to exactly what constitutes tabular data. For example, if I have a form, in which the user is required to fill in various bits of information, then laying out with a table makes it easy. |
#4
| |||
| |||
|
|
In the case of a form in particular, you might make a case that the captions and the fill-ins (text boxes or option lists) are logically a two-column table, with each caption tied to its fill-in. But that breaks down if you have any fill-in without a caption. |
#5
| ||||||||
| ||||||||
|
|
The main advantage of this (ab)use of tables is that the cells automatically line up both horizontally and vertically. They line up horizontally. Any block-level elements will line up those elements vertically. E.g.: Example of section 17.4.2 Examples of forms containing INPUT controls http://www.w3.org/TR/html401/interac....html#h-17.4.2 |
|
Can this be done in CSS? Probably. I think so, yes. |
|
No, I wouldn't say abuse. Forms (like a subscription form) are often formatted with tables. |
|
What's absolutely nonsense to me is - use of nested tables |
|
- using table for nothing that is remotedly close to tabular data |
|
- using table with all kinds of spacer.gifs, dozens of for horizontal padding, dozens of <br> for vertical ventilation - seeing a page that has 10, 30 or 50 tables |
|
Any comments? This is a genuine question, It's ok. It's called a discussion newsgroup. ![]() |
|
I'm sure you will find possible CSS alternatives in the links of this page: Table-based webpage design versus CSS-based webpage design: resources, explanations and tutorials http://www.gtalbot.org/NvuSection/Nv...CSSDesign.html |
#6
| |||
| |||
|
|
As soon as you state it to yourself as "laying it out", alarm bells should go off in your head. That tells you're you've skipped over the essential step of asking whether your data actually are tabular. |
|
In the case of a form in particular, you might make a case that the captions and the fill-ins (text boxes or option lists) are logically a two-column table, with each caption tied to its fill-in. |
|
But that breaks down if you have any fill-in without a caption. |
#7
| |||
| |||
|
|
The main advantage of this (ab)use of tables is that the cells automatically line up both horizontally and vertically. Can this be done in CSS? In this page, http://www.alistapart.com/articles/practicalcss/ search and find the section titled "FORM(s) and Function" "Another common use for table layout is lining up FORM elements with their labels. While it could be argued that this is an appropriate use of TABLEs, the CSS technique that I describe below will prove to be useful (...)" |
#8
| ||||||||||
| ||||||||||
|
|
E.g.: Example of section 17.4.2 Examples of forms containing INPUT controls http://www.w3.org/TR/html401/interac....html#h-17.4.2 Yup, they line up horizontally, but *not* vertically. This was precisely the problem I wish to avoid. Is that vertical lining up problem so bad? really really bad? |
|
This form looks awful, and will cause the user to become confused. The table approach means that all the entry boxes are vertically aligned. Can this be done in CSS? Probably. I think so, yes. Please show me how ;-) I have in another post. |
|
Before you do though, I should point out that another advantage of the table approach is that you don't need to specify a width for either column. This is debattable. Declaring a width for <col> and declaring table-layout: fixed will speed up parsing and rendering in all modern browsers. |
|
The rendering device decides what width to give them, based on the size of the available space, size of contents, font size, etc. Fixing the width, even using ems does not give that flexibility. I never used em for col width; I always used %tage instead. |
|
snip No, I wouldn't say abuse. Forms (like a subscription form) are often formatted with tables. So are you saying that you feel this is an appropriate use of tables? Maybe it's not the best usage. I think what you do is acceptable use of table. |
|
In a spreasheet application or a database application, one could be using a table to render customer info and its related personal data. |
|
What's absolutely nonsense to me is - use of nested tables Depends on the context. I have no relativity on nested table. A table of tables makes no sense to me. I wouldn't be able to see or use one in MS-Excel or any spreadsheet application. |
|
Nested tables is no more sensible than typing on a keyboard located inside another keyboard, a car traveling inside another car, reading a book inside another book, etc. |
|
I can think of plenty of times when this is appropriate. Unfortunately, the vast majority of cases in the wild are not ;-) Well, that was and still is the challenge issued by David Dorward: "If you really do have data that should be in nested tables, I do want to see it!" http://dorward.me.uk/www/nested/ |
|
- using table for nothing that is remotedly close to tabular data Agreed, hence my question. Can a form be called tabular? No. A form can be tabular depending on the data it presents. |
#9
| |||
| |||
|
|
"FORM(s) and Function" Try increasing the font size of your browser and look again at that form. The captions become bigger than the fixed space allocated to them, and the second "column" entry goes down a line, destroying the neat arrangement that a table would give. The widths were specified in px units rather than ems. |
|
Furthermore, if the user has a big monitor and maximises their browser (using the common example of a computer user viewing the form in a web browser), then the fixed width column stays the same width. They don't get the benefit of the wider space that their big monitor allows. A table will be resized to use as much space as it can. This is another big advantage of using tables. It is not uncommon for table-based forms to fix the width of columns as |
#10
| ||||
| ||||
|
|
"FORM(s) and Function" Try increasing the font size of your browser and look again at that form. The captions become bigger than the fixed space allocated to them, and the second "column" entry goes down a line, destroying the neat arrangement that a table would give. The widths were specified in px units rather than ems. |
|
Furthermore, if the user has a big monitor and maximises their browser (using the common example of a computer user viewing the form in a web browser), then the fixed width column stays the same width. They don't get the benefit of the wider space that their big monitor allows. A table will be resized to use as much space as it can. This is another big advantage of using tables. It is not uncommon for table-based forms to fix the width of columns as well. |
|
You may not do that allowing the form to fill the space. Using percentages for widths instead of pixels would accomplish the same thing in the non-table form. |
|
There is no doubt that tables have certain advantages for layout. Just not enough. |
![]() |
| Thread Tools | |
| Display Modes | |
| |