CSS Multiple multi-column divs

Posted by accelerate on Stack Overflow See other posts from Stack Overflow or by accelerate
Published on 2010-04-12T01:09:16Z Indexed on 2010/04/12 1:13 UTC
Read the original article Hit count: 278

Filed under:
|
|
|

I have a bunch of items (text, image, mixed content, etc) that I want to display. The user can define what row and what column that item appears in. For example, in row 1, there could be two items/columns, both images. In row two, there could be three items / columns, one with an image, two others as pure text. Oh, and the user may specify the width of any particular column/image/item.

I have a solution that uses multiple tables that works. In essence, each row is a new table. This works for the most part.

I'm wondering if I can use just divs?

Now my CSS foo is lacking, and I tried to copy examples from the web, and I haven't been able to get it working. Right now I have something like this:

`[for each row]

[for each column] [content]


`

But everything is overlapping each other.

I've also tried using "position: relative", but things look even more borked.

So can divs actually be used for multiple rows and different number of columns?

© Stack Overflow or respective owner

Related posts about html

Related posts about css