Letterbomb05 Posted May 4, 2009 Share Posted May 4, 2009 Hi, 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. ~Letterbomb05. Quote Link to comment https://forums.phpfreaks.com/topic/156776-solved-divs-like-tables/ Share on other sites More sharing options...
the182guy Posted May 4, 2009 Share Posted May 4, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/156776-solved-divs-like-tables/#findComment-825591 Share on other sites More sharing options...
Axeia Posted May 4, 2009 Share Posted May 4, 2009 Getting the exact behavior is impossible crossbrowser. What exactly are you trying to archieve, as there are many ways most things can be done. Quote Link to comment https://forums.phpfreaks.com/topic/156776-solved-divs-like-tables/#findComment-825650 Share on other sites More sharing options...
Letterbomb05 Posted May 4, 2009 Author Share Posted May 4, 2009 I am trying to achieve this sort of layout: Quote Link to comment https://forums.phpfreaks.com/topic/156776-solved-divs-like-tables/#findComment-825677 Share on other sites More sharing options...
Ken2k7 Posted May 4, 2009 Share Posted May 4, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/156776-solved-divs-like-tables/#findComment-825726 Share on other sites More sharing options...
Letterbomb05 Posted May 4, 2009 Author Share Posted May 4, 2009 Thanks, I wouldn't use absolute positioning anyway; I've been there and done that along time ago. I'll use your advice and try and get things working, thanks for the help! ~Letterbomb05 Quote Link to comment https://forums.phpfreaks.com/topic/156776-solved-divs-like-tables/#findComment-825732 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.