HighDots Forums  

Table-like behaviour with CSS

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss Table-like behaviour with CSS in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
André Wagner
 
Posts: n/a

Default Table-like behaviour with CSS - 04-28-2008 , 10:45 AM






Hello!

(please read this message using fixed-font)

I'm writting a website with boxes of content. The number of cells in
each row might change depending on the browser window size, and the
content will be something like this:

AAAAA BBBBB CCCCF
AAAAA BBBBB
BBBBB
BBBBB

DDDDD EEEEE FFFFF
EEEEE FFFFF
EEEEE FFFFF
EEEEE

I'm trying to use this box model in CSS:

.caixa {
width: 190px;
height: 150px;
margin: 0 10px 10px 0;
float: left;
display: block;

}

It works, but the problem is that I don't want a fixed height, I want
the height to auto adjust (pretty much like a table in HTML).

If I remove the height attribute, I get something like this:

AAAAA BBBBB CCCCC
AAAAA BBBBB
BBBBB FFFFF
DDDDD BBBBB FFFFF
FFFFF
EEEEE
EEEEE
EEEEE
EEEEE

Please help me! What can I do to get the first behaviour?

Thank you in advance!

André

Reply With Quote
  #2  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: Table-like behaviour with CSS - 04-28-2008 , 11:11 AM






André Wagner wrote:
Quote:
Hello!

(please read this message using fixed-font)

I'm writting a website with boxes of content. The number of cells in
each row might change depending on the browser window size, and the
content will be something like this:

AAAAA BBBBB CCCCF
AAAAA BBBBB
BBBBB
BBBBB

DDDDD EEEEE FFFFF
EEEEE FFFFF
EEEEE FFFFF
EEEEE

I'm trying to use this box model in CSS:

.caixa {
width: 190px;
height: 150px;
margin: 0 10px 10px 0;
float: left;
display: block;

}

It works, but the problem is that I don't want a fixed height, I want
the height to auto adjust (pretty much like a table in HTML).

If I remove the height attribute, I get something like this:

AAAAA BBBBB CCCCC
AAAAA BBBBB
BBBBB FFFFF
DDDDD BBBBB FFFFF
FFFFF
EEEEE
EEEEE
EEEEE
EEEEE

Please help me! What can I do to get the first behaviour?

Thank you in advance!

You cannot. You cannot specify a "virtual grid". You either have to set
a fixed height to accommodate your max content and have the floats line
up their tops as they create their virtual rows to the available window
width. Or you will have to set a fix number of "cells" per row and use
clear, no advantage over table.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.