View Full Version : css vs table
Hi,
Just wondering how can table be replaced by css... Need some ideas?
I have a web site with about 500 pages, they are not well coded. Recently, I started to convert them to HTML 4. Is it a good idea to convert to XHTML? How about browser compatibility?
Regards,
Deependra b. Tandukar
vwebworld
04-02-2004, 08:22 AM
Eventhough I use CSS, I think tables still have
their place. I find tables easy (for me) to use to
"control" the placement of various items on a web page.
Here are a couple of links for CSS / Table info:
http://glish.com/css/
http://www.w3.org/TR/REC-CSS2/tables.html#q1
http://www.projectseven.com/tutorials/css_t/
~ROland
voodooboy
04-02-2004, 02:38 PM
Now is not the time to replace table elements for CSS. The only real support is from IE on PC. Other than that, there are issues with all other browsers and platforms regarding CSS as a layout language. Use it for color and design, fonts and links, but leave the layout to the tables.
Give it a couple years. Maybe the rest of the browsers will come into compliance; but until then you are looking at nothing but heartache.
My .02 cents.
splinter
04-02-2004, 03:08 PM
Huh??? I hope you were joking there.
IE6 has the buggiest CSS support out of all the latest browsers. Even the CSS1 is buggy. Don't tell me about how many problems I've had with the float property in IE.
Also, strange things can happen if you put width and padding in the same class.
On the other hand, Netscape 7 and Opera 7 work like dreams. Everything I want CSS to do works perfectly with them.
Also, tables are evil for design. Take a look at tutorial 2 in the site design section (you may even notice my pretty face :P).
Also, it's quite easy to create great looking designs in CSS. [showing off]Take a look here (http://home.graffiti.net/spl1nter:graffiti.net/) for a nice (incomplete) design. Take a look at the code if you want. Only 1 table and that's for the calendar.[/showing off]
It also allows to customise your site very easily. I've completly changed the look of the above site in a matter of mins.
ChrisRC
04-02-2004, 03:27 PM
The only real support is from IE on PC
How so? IE6 does support css-p about as well as any browser (if you take a few quirks into consideration), but I don't see that it does any better than Mozilla. What advantages does IE offer?
Some resources for DT:
Joe Gillespie's browser test (http://www.wpdfd.com/editorial/wpd1003.htm#feature)
BrainJar's CSS-P page (http://www.brainjar.com/css/positioning/default.asp)
Craig Saila's CSS v Table article (http://www.saila.com/usage/layouts/cssvtables.shtml)
Jeff Zeldman's ALA article (http://www.alistapart.com/articles/journey/)
acsinclair
04-02-2004, 04:17 PM
I think that both Tables & CSS positioning have a place in today's world. I prefer doing mostly tableless designs...but I use tables when they are more appropriate for my audience of endeavor. I think it is misleading to say that it is not "time" yet for tableless layouts. If not now, when? Don't be left behind because you are scared to embrace newer technologies. Check out the following article by Al Sparber:
Clarence The Pony (http://www.projectseven.com/grafitti/clarence0602/index.htm)
Also visit The CSS Zen Garden (http://www.csszengarden.com) for a terrific display of what can be accomplished with CSS. And be sure to check out my design submission entitled Happy Hour.
Cheers,
Erica
vwebworld
04-02-2004, 09:32 PM
To quote that article (emphasis added):
There's nothing inherently wrong with using tables to layout a web page. They are great for rapidly deployment sites for clients who need to support a wide range of older browsers, or in any site that needs to display organized tabular data. Tables are not evil. But in terms of web page design, nothing is absolute. The target is constantly moving... but not in circles. To only use tables is as wrong a decision as to never use tables. Not to embrace CSS, could be tantamount to a slow professional suicide
There is some beautiful stuff created with CSS
ala Zen Garden... but "tableless" web pages are not
for everyone nor do all browsers support CSS (CSS2+).
This subject always seems to provoke the extreme
views of tables bad / css good and CSS s**ks / tables
rule.
In any case, it appears that Deependra's post has
been answered with the various CSS links already posted :-)
"Peace out..." "Attica! Attica!" "you talkin to me?"
Whoa, sorry got carried away there....
~Roland
matauri
04-03-2004, 02:58 PM
The one thing I prefer of CSS in comparison to tables, is the versatility of design without overloading your page with images & reams of code. Tables aren't evil, I still use them for appropriate content layout, but they just arent as versatile as CSS IMO.
In reference to buggy, I find IE the buggiest. I can design a site & it look faultless in Firefox, Mozilla & Opera...then I open IE and its search for the problem. To combat this I have a standard set of attributes I put with each class & ID to overcome this problem to the greater degree. I found that if I tell the browser 'exactly' what I want & what I dont want, I can cover most problems, not all. I've tried many 'quirk' solutions, and have found none that work on all.
But in answer to original question....
Is it a good idea to convert to XHTML? How about browser compatibility?
I'll give the same answer I would give clients... there are problems associated with converting & not converting. You have to balance out whether you are going for longevity or backward compatability. You also have to take into consideration your target audiences. i.e. Many educational institutions run Macs, and Safari seems to be the only browser that has a higher degree of compatability...so then I would consider not using XHTML for anything where they might be a focus group. If its for your own site..I say 'go for it'! XHTML/CSS can be a lot of fun to design with.