Topic awaiting preservation: Mixing Tables and CSS (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Minneapolis, MN, USA |
posted 03-21-2002 18:07
So far I haven't yet ventured into full-CSS designs. I've always heard that you can't mix tables and CSS. But does that mean you can never have a <table> within a <div>? Or just that you shouldn't attempt complicated layout techniques with tables when you are using absolutely positioned <div>s? Seems to me tabular data should still be in tables, but what do you guys think? |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 03-21-2002 18:11
Bah. There's no rule preventing you from combining the two. Many "cross-browser XHTML" purist's argue against tables but really in some situtations they do the job excellently and should be used. |
Maniac (V) Mad Scientist From: New California |
posted 03-21-2002 18:16
I recently tried to do a page without tables using CSS only. I wanted a header and two divs side by side for the middle and a footer... and all of that centered on the page. You know, the kind of thing you can easily do with tables? Anyway, I got it to work pretty well in IE5+ and was quite happy. I brought it up in Mozilla and it looked like dog crap. I forgot what Opera did with it. |
Maniac (V) Mad Scientist From: New California |
posted 03-21-2002 18:19 |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 03-21-2002 18:28
Even the most extreme web standards advocates agree that tables should be used for tabular data. That is, after all, what they exist for. |
Paranoid (IV) Inmate From: Minneapolis, MN, USA |
posted 03-22-2002 18:45
Well I've already used most parts of CSS1 and some of CSS2 other than the positioning attributes (I use CSS for font sizes/faces/colors, margins/padding, some rollovers, etc), but I've never taken it to the level of significant layout using CSS or dHTML. Reading through the spec, and considering the number of browser issues, I know I have only begun to scratch the surface. |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 03-22-2002 19:53
Bugs - |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
posted 03-25-2002 22:37
jiblet: As has been explained there is no problem mixing CSS and tables. Tables are still the only way to get some designs to work in NS4.x - you just have to adapt your strategy to the project. If you are aiming for a more 'advanced' audience (ones who upgrade their browsers often, e.g.) then CSS-only layouts may be the solution for you. If you are building a big ecommerce site then (or any site expecting a lot of traffic from a broad range of people) then you should really drop in a table or 2. |
Paranoid (IV) Inmate From: Minneapolis, MN, USA |
posted 03-26-2002 17:01
Actually, that's a very good point emp. If there is only one column then a div is probably better than a table. I think i've been using tables just because I was more familiar with the touchy details of margins and padding on tables than divs. But since I've already achieved much greater consistency by replacing my <ul> and <h1-6> tags with <div>s, it would only make sense that floating <div>s would also be easier to manage than floating <table>s. |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
posted 03-26-2002 21:48
jiblet: Yes DIVs make a very good replacement for tables in a lot of circumstances - there are possibly exceptions but you really only need tables to hack cross-browser columns. However, I would be wary about getting rid of markup like your lists and headers. Especially in our new shiney XML world these do have significance beyond simple styling (and again when used correctly they can help various devices make more sense of your page). You will also find that some search engines will rank you higher in searches if you have the keywords in important 'structural' tags - like your headers (clearly being in a H1 would be more important than a H3), page title, bold/strong and italic/emphasis tags so ignore these kind of tags at your peril. |
Paranoid (IV) Inmate From: Minneapolis, MN, USA |
posted 03-27-2002 04:44
By elegant I mean simple code to produce difficult or unusual effects consistently across the widest number of browsers. |
Maniac (V) Mad Scientist From: New California |
posted 03-27-2002 05:25
Thanks on the heads up on the glish.com I'll see if that helps with the stuff I was trying to do. I want to make this stuff work... it just gets so frustrating at times. |