SV: [thelist] Advanced Table Design using only Divs and CSS.

Andreas Wahlin Andreas.Wahlin at ufl.gu.se
Tue Aug 10 02:36:42 CDT 2004


<When resizing the window I want only the column with variable width to
expand, shrink and stop shrinking when you reach a minimum width even if
you continue resizing the browser window.>

I'm no CSS God or anything, and I don't even know if I got your question
exactly, but I have a div in the middle, and a div to each side (well,
that's when tehy're positioned). The side DIV's are of fixed size, while
I have declared the middle div width with EM's. Like so:

#main {
	display: block;
	position: relative;
	text-align: justify;
	width: 37em;
	max-width: 90%;
	margin: 1% auto 2% auto;
	z-index: 10;
	line-height: 1.4em;
}

#left {
	position: absolute;
	top: 10em;
	left: 1em;
	width: 150px;
	z-index: 5;
	text-align: left;
}

I also declare all fonts with EM's, this makes it so the text almost
always take up the same relative space in the div, that is, a line that
is 12 words long will stay 12 words long however I resize the text,
which I think is good since about 12 words seem to be a desired length.
Is this somewhere near what you wanted? 
The only problem with the layout is that if you resize to much, the left
div will overlap the main div, I solved that by having a javascript move
the left div should need arise, this is only in extreme circumstances
though so you should be able to make it even not using javascript.

Andreas


More information about the thelist mailing list