Jump to content

Aligning when using <div>'s like tables


ChrisUehlein

Recommended Posts

So I am currently trying to take away all the tables in my web site, gnartapes.com, and have been replacing them with DIVs, and using CSS to make them behave like tables. It's cool, but now everything is misaligned because I can't use colspan. How do I align everything right? Click here to see the problem page with DIVs, and to check out the source if necessary. You can reference it to gnartapes.com to see what the page looks like using tables, and what I want it to look like using DIVs.As always, thanks again for the help!

Link to comment
Share on other sites

There are a few ways to do it, the differences depending on how you are setting the width of the divs that come below. Say you have three divs, each 200px wide, with a 20px margin (total) between the two. If you want a div to sit on top of that with the effect of colspan = 2, you would set its width to 420px and float it left or right, depending on where you wanted it to sit above the three divs. You also need to make sure that the divs in the next row have 'clear' set, either left or right, or both just to be safe. With a layout based on percentages, it's the same thing, just replace the px widths with %.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...