Hello,
Sorry if this is covered somewhere, but I've looked at countless sites
explaining how to do multicolumn layouts in CSS, but have yet to find
one that does what I want.
In the old days, I would use something like this (deliberately small
fragment of air code, so no comments about validity please!!) to produce
a two-column layout, where the left column was (say) for site links...
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top">
<small>
<a href="...">Ferr ets</a>
<br><a href="...">Gibb ons</a>
<br><a href="...">Vole s</a>
</small>
</td>
<td align="left" valign="top">
This is where the main content goes...
</td>
</tr>
</table>
The advantage of this is that the left column would only be wide enough
to fit the links, and the right column would expand to fill the rest of
the window (assuming it had enough content of course).
I have been looking to do such a layout in CSS, but can't see how. All
the examples I've seen use DIVs for the columns, and float them. They
set the width of the left DIV either as a fixed value in pixels, ems,
etc, or as a percentage. Either way, the left column's width is
independent of the contents. If the text of the links are all short,
then you waste space in the left column. If there are long texts, they
overflow the DIV and spill into the right column.
Is there any way to set it so that the left column is only as wide as
needed by the contents, and the right one uses the rest? As I said, I've
searched and searched, I've followed loads of links from posts in this
group, but I've yet to find a layout that is as flexible as the old
table one. I would be very grateful if anyone can point me in the right
direction.
TIA
--
Alan Silver
(anything added below this line is nothing to do with me)
Sorry if this is covered somewhere, but I've looked at countless sites
explaining how to do multicolumn layouts in CSS, but have yet to find
one that does what I want.
In the old days, I would use something like this (deliberately small
fragment of air code, so no comments about validity please!!) to produce
a two-column layout, where the left column was (say) for site links...
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top">
<small>
<a href="...">Ferr ets</a>
<br><a href="...">Gibb ons</a>
<br><a href="...">Vole s</a>
</small>
</td>
<td align="left" valign="top">
This is where the main content goes...
</td>
</tr>
</table>
The advantage of this is that the left column would only be wide enough
to fit the links, and the right column would expand to fill the rest of
the window (assuming it had enough content of course).
I have been looking to do such a layout in CSS, but can't see how. All
the examples I've seen use DIVs for the columns, and float them. They
set the width of the left DIV either as a fixed value in pixels, ems,
etc, or as a percentage. Either way, the left column's width is
independent of the contents. If the text of the links are all short,
then you waste space in the left column. If there are long texts, they
overflow the DIV and spill into the right column.
Is there any way to set it so that the left column is only as wide as
needed by the contents, and the right one uses the rest? As I said, I've
searched and searched, I've followed loads of links from posts in this
group, but I've yet to find a layout that is as flexible as the old
table one. I would be very grateful if anyone can point me in the right
direction.
TIA
--
Alan Silver
(anything added below this line is nothing to do with me)
Comment