Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/50662-tables-vs-css/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/50662-tables-vs-css/#findComment-249022
Share on other sites

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....

Link to comment
https://forums.phpfreaks.com/topic/50662-tables-vs-css/#findComment-249437
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.