View Full Version : Problem with tables to CSS

04-29-2006, 12:29 AM
I've worked with CSS for at least 1 and a half now and I think I'm pretty damn good, but one problem I've always had is liquid layouts. Getting the percents right without tables is kinda a problem.

I run a forum at songswewearpantsto.com (http://songswewearpantsto.com/index.php) (Fan forum) and I run it using phpBB. Recently, I came upon punBB and I fell in love with it because of the complete lack of Tables. I set out to convert a tables layout into CSS. Well halfway through it I hit a problem. I can't get the right DIV to go down gracefully when you have a 800x600 resolution (That's one problem I wanted to fix with the converstion. Here's where I'm at on the CSS converstion. (Link (http://www.shehatesska.com/portfolio/punnypants/index.html)). Please help me by making the tables to CSS converstion work. Thank you very much and I think I'll stay on this forum for a long long time.

04-29-2006, 12:39 AM
A fluid layout in CSS isn't that hard really. Basically you have the fixed width left nav and then the content which just has a left margin that is equal to or greater than the width of the left nav.
For you good browsers you can use min-width so the browser will make a scrollbar at the width you set. For IE there is a way to fake min-width.
It will work but you might want to change the #FFF to match your background color. You can also use javascript if you prefer.

<!--[if gte IE 5]>
<style type="text/css">
body {width:expression( documentElement.clientWidth < 600 ? (documentElement.clientWidth == 0 ? (body.clientWidth < 600 ? "600px" : "auto") : "600px") : "auto" );}
Just change the 600 to match the width you want to set the 'min-width' as.

04-29-2006, 12:50 AM
Thanks man, I'll come back in like 30 minutes when I try this out.