View Full Version : nested tables
JulieAsking
07-05-2005, 02:29 AM
Basic question by newbie. I am unclear as to why you would need to nest two out of three tables in the following exercise:
Instructions:
1. Using DWMX2004 create 3 tables, 1 row and 1 column each and 750px wide.
2. In first table insert another table, 1 row and 5 columns. This is to be used for a company logo in the first column and the remaining four columns will hold images to be used as navigation.
3. Insert image into second table (no nesting).
4. Insert table into third (original) table, 1 row and 3 columns - images to go in first and last columns and text in middle column.
This all works fine but I don't understand why I can't just create the original first table with 5 columns and add the content without nesting. And same with third table - just create it with 3 columns and add content. What is the benefit of nesting tables in the first and third original tables?
Julie
_Aerospace_Eng_
07-05-2005, 02:54 AM
Just use column and row spans instead rather than nested tables. If possible don't use tables at all. Tables aren't for web design, they are for displaying data.
JulieAsking
07-05-2005, 03:11 AM
Aero thanks for your reply. I understand what you are saying but many sites are still built on tables during the transition to css. I will be using tables for my basic layout with a css stylesheet. My website will be used by people 60 years and older so I think tables are still safer in terms of what older browsers they may be using.
For the purpose of this particular exercise I would still like to know the reasoning behind nested tables. I understand they take a little longer to download but there must be some advantage to nesting that I am missing (teaching myself).
Julie
_Aerospace_Eng_
07-05-2005, 04:24 AM
You don't have to worry about row spans and column spans in the main table because tables most of the expand to fit the space they are in.
ronaldb66
07-05-2005, 09:38 AM
Nesting tables, in fact using tables for layout in the first place, was about the only way to have some control over web page layouts before CSS was available. Nesting tables is in fact a very bad habit that should be avoided as much as possible.
If for some reason or other you're not comfortable with CSS positioning for layout purposes you can use a (1) table to create multiple columns, but try and keep it to a minimum. Most browsers, even old ones, do support at least some of the CSS1 standard so white space can safely be controlled with margins and padding; there really is no need anymore to use nested tables, spacer gifs and empty cells for that.
Moreover, although it may be true in some cases, I don't think it's fair to assume that all old people use outdated browsers, and even if they do, continuing to use outdated techniques to accommodate those will eventually hurt more users than help them.
NancyJ
07-05-2005, 12:56 PM
surely the person to ask is the person who set the excercise.
Obviously there are multiple solutions to most problems but if you've been told to do something in a certain way and you dont believe its the best way then why dont you just ask the person who told you to do it like that why you cant do it in the way you would do it.
JulieAsking
07-06-2005, 05:02 AM
Nancy your comment wasn't of much use. The instruction is on a CD ROM.
Julie
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.