Jump to content

[SOLVED] Divs like Tables


Recommended Posts


I'm wondering if anyone has a solution to using divs like tables. Of course, I HAVE Googled this before posting, and the most popular result isn't really cross browser compatible; if I used the technique of display:table and display:table-row etc, my design would be screwed in even slightly older browsers.


Thanks in advance for any help.



Link to comment
Share on other sites

A simple way would be to float:left each div that will represent a table cell. Have a containing div wrapped around them all, so when each cell is floated left (also use a fixed width) they will stack up to look like table cells.

Link to comment
Share on other sites

Before someone else starts talking, I'd like to say that if someone posts telling you to use position absolute and top|right|bottom|left CSS to place everything in the correct place, don't do it.


It would take a bit of DIVs to get that effect. Basically, you want an outer DIV to wrap all the inner DIVs. The left fixed box should be floated left. Give it a set width. Do the same for the right column, but float it right.


For the stuff in between, you would want an inner DIV wrapping all 4 of those boxes. Give it a set width and float it left. Use margins etc to space them apart from the left and right column.


The bottom 3 DIVs, do the same thing. Wrap them all in DIV and do each one separately.


Doing all in DIVs is possible, but you need to be good with CSS and HTML layout as well. If not, you'll end up with something looking good in Firefox and horrible in IE 7 or other browsers.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.