adamcannon Posted May 9, 2007 Share Posted May 9, 2007 Should CSS DIVs be used in place of TABLESs? I'm a novice at CSS but it seems to be much more flexible than TABLEs in its display options. For example, to display data on the right side of the screen with TABLEs, you'd need empty TDs which doesn't work well with graphics. Opinions? Thanks, adam Quote Link to comment Share on other sites More sharing options...
soycharliente Posted May 9, 2007 Share Posted May 9, 2007 Both tables and divs have their advantages and disadvantages. You are correct in that you'll need at least a in the cell for it to even render, especially if you are using borders. With divs you can be more flexible. BUT, in my experience, using divs makes it harder to align the table layout on the far right side. Especially if you are trying for something like a 3x3 look. If the text on the top fills up the div and the text under that doesn't, they might be different lengths in the end. Also, You have to be careful when putting divs on the same row. IF you try to float too many and mess up the percentages then you'll have one drop down. With tables, you're guaranteed that they'll all be all the same row no matter what. It all depends on what you want to do. You can definitely use CSS with your tables to achieve the same look. I've done CSS with tables a ton and would be glad to help any way that I can. Quote Link to comment Share on other sites More sharing options...
adamcannon Posted May 9, 2007 Author Share Posted May 9, 2007 charlieholder, you've pretty much convinced me to stick with good old TABLEs. Plus, I think server side scripting languages work better with them. Quote Link to comment Share on other sites More sharing options...
veridicus Posted May 9, 2007 Share Posted May 9, 2007 Actually I find coding server code to product divs to be much easier. The content is wrapped in one element instead of a nesting of elements. But for layout I usually end up falling back to the table. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted May 10, 2007 Share Posted May 10, 2007 Divs are the best way to lay out a page. The flexibility of divs and css and doctype declarations are truely your friend. As I have said before tables are for eating dinner off or displaying tabulated data. I have also stated that a couple fo days working with divs and learning a bit of css will be the most productive in your time as a web page developer. Tables have MUCH more ability to destroy the look of your page and when nesting them the potential porblems increase exponentially. As Veridicus states, managing your content by enclosing associated elements in a div is by far the best way to manage your sites. Not to mention the fact that some users don't have the benefit of good eyesight and use other clients to view your page. Tables can make screen readers render your page completly unintelligable. To desing a good site you should start from teh premise that the person seeing you page has css off, javascript off and images disabled - if then reading your page still makes sense you are doing well. You can then add all the nice bits on and create a rich and engaging visual experience. Ask your self this - all (most) the professionals in the game endevour to follow a standards complinat route and separate content from style from document effects why? A - its the easiest way to develop/manage/update sites and produce good end result.... Quote Link to comment 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.