Layout tables/cells

G

Guest

Had to leave my project for a while but I'm back trying to re-create the site
(surfinlocal.com) I originally built completely wrong (VML, layers, AP).
Before my traditional "page layout" frame of mind gets me in trouble again,
please tell me if I should be using the "layout tables/cells" or the original
table format. I am trying to achieve as much browser compatibility as
possible. If layout tables are OK, should I stick to one table per page with
lots of cells?
 
M

Murray

If layout tables are OK, should I stick to one table per page with
lots of cells?

Definitely not. That single table layout approach causes new developers to
consider alternate employment.

Any approach can be good if you understand the underlying HTML. Any
approach will be flawed if you do not.

Here are some things to remember about using tables as a layout tool (note I
didn't say Layout mode).

1. Do not build an entire page in a single table unless it is a very simple
page. Why? Because if you do, you will most likely need to use col- and
rowspans to position things where you need them - see below for more.
2. Do not merge/split cells in a row or a column as a general layout
method. A merge/split here and there is not a problem, but a single table
littered with col- and rowspans (what happens when you merge/split) is a
very fragile beast. In such a table, a single change in one cell will
ripple throughout the whole table like a tsunami and cause all kinds of
unwanted displacements.
3. If you need to merge cells, consider stacking two tables instead. In
other words, end the table in the row before the merge row, and begin a new
table underneath with the desired column structure.
4. If you need to split cells, consider nesting tables instead. While it
is true that a deeply nested table structure can be a problem, nesting
simple tables is far less problematic than splitting just a few cells in a
single large table. When I say "simple tables" I mean ones with no
merge/splits.
5. Do not rely on cell dimensions to hold things together. The trick to
working with tables is to not try to bludgeon them into shape with
dimensions. It's much better to load strategic cells with inflexible
content (like a transparent GIF image with set dimensions) and allow the
table to collapse around these contents. This way, you achieve what you
want and the table achieves what it wants (if I can refer to what the table
'wants').
(Of course, using CSS to specify the table's structure is an even better
way, but that's another thread.)
6. Notwithstanding this guideline to not rely on cell dimensions, it is
useful to set cells to 100% width. This will cause them to 'balloon' out,
applying an inner tension on the table's structure, and forcing things into
shape. While the following tutorial is Dreamweaver oriented, it is an
excellent one, and will show you how valuable this approach is -

http://www.dwfaq.com/tutorials/Tables/flexible_tables.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top