<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head><title>DIV Test</title><style type="text/css"> div {line-height: 1.5em; height: 2em;} div.c1 {border: 1px solid green; height: 200px; width: 400px; margin: 0; } div.d1 {border: 1px solid red; width: 40%; height: 100%; float: left;} div.d2 {border: 1px solid blue; width: 40%; height: 100%; float: right;} </style></head><body> <div class="c1"> <div class="d1">d1</div><div class="d2">d2</div> </div> </body></html> Code (markup): That should work fine... and about the amount of work.... some would say they don't understand tables and say they are able to do it faster with CSS I can do it faster with tables... (using notepad) But I guess in the end.... the standard will go as a combo with tables and divs... each serving it's best purpose
sorry, I was away for a few days, so haven't had a chance to answer; I never claimed my site was compliant. It's a rather large site to maintain and i"ve only recently started validating pages, so it's no great surprise that a page doesn't validate yet Still, I don't blame the browser if it screws up due to my mistake - I'm happy to blame myself! I don't bother with Opera. I have played around with what you describe, but I think it's only on PC's they offer this functionality and as I usually use my mac for developing / testing, it has little point.
Somehow I didn't see your post. Sorry. Floats are rather a neat workaround if you use div's as menus or sidebars. Say, if there are three floats, one left-aligned and two right-aligned, closing the gap between them will require a bit more work (as well as managing margins, paddings and border widths). Precisely. BTW, the standard is already a combo J.D.
How interesting I found this post. First of all, I'd like to address the original question. "Why I dont like tables?" My answer is, I love using tables, tables rule even though you have a lot of nested tables. I never had any problem nesting tables. They are easy to work with and pretty much output as expected most of the times. Like J.D, I have always used the combination of tables with css. And I agree with J.D. in that, css makes my life much easier. Now, I must say when I first saw the thread, I also thought it was a topic to discuss table layout vs div layout. Sorry people do assume.... and I am a programmer so I always make assumptions... I guess another reason why I made that assumption was because I have been working on converting my table-layout pages to div-layout pages for the whole week this week. In my case, I WAS trying to replace my tables with divs. The reason why I even had that idea was flexibility. With absolutely positioned divs I can order my content any way I want within my html, which I dont think can be achieved with tables. Also it takes less characters to make a div than it is to make a table so it is cleaner and your html can be rendered faster. I also am not a css expert. It took me a while but finally I came up with a header-footer-2 column layout using divs only where the two columns' length will always match. The left column is my nav menu, the height pretty much stays the same. It is the right column(main content) that will vary from page to page. So for a moment I thought hey its not all that hard, got 3 of my pages converted and they all looked good in IE6 and NN7. Just to test some more, I tried out my test pages in NN6. Darn, what happened?? My layout is all messed up. Considering the number of browsers out there, new browsers in the future, and different versions of each of these browsers, I am not sure if the benefits of using div-layout can justify the efforts to make them work across browsers. I understand you can detect user's browser and use style accordingly, but that is just too much work vs using tables. At this point, I am staying with tables. I do wanna hear from those who prefer divs over tables, how do you do it? I would love to be convinced, seriously... I know this is kinda long, thanks for reading, look forward to hear from others.
QUOTE <With absolutely positioned divs I can order my content any way I want> if you use absolute position and someone selects 'text size larger' for easy viewing, doesn't the absolute position bit explode all over your content? not sure about this as i have never used absolute positioning on anything,ever.
Very good observation From my tests, it actually will just make the column longer, and since, as i have mentioned, the two columns length always match, so it is not really a problem. What COULD be a problem though, is when you have a string of characters that are too long ie an url that has no space and hence cannot be wrapped, that will definitely mess up the layout. But I am pretty sure the same will happen with tables. Again, I am not a css expert. I have tested my pages many times but I did not say I have fully tested the pages. As soon as I see how my pages look like in NN6, I have not touched them since... As I said in my previous post, I am not sure if it is worth the effort. I spent almost 2 days just to come up with a div layout that finally worked(at least in IE6 and NN7 hehehe), I dont even need 2 minutes to create the same effect with tables.
Tables go hand-in-hand with CSS. Here's the CSS chapter on tables: http://www.w3.org/TR/REC-CSS2/tables.html In HTML4 all HTML formatting is depreciated in favor of CSS. To me css just complicates tables I like tables
I agree...CSS and Tables are complimentary. CSS cannot do everything yet, but the 3.0 standard will move it closer. I do page layout and structure with tables, handle formatting of text with external CSS. I consider myself a CSS newb...it's still foreign to me, I hit reference material constantly when working with it. The "class" attribute is a wonderful thing.
I agree (I do use iframe sometimes, though). The only thing that bothers me about no-frames HTML is that the target attribute in <a>'s is valid only in the frameset DOCTYPE and not in strict. So, the following is not valid HTML strict: <a href="..." target="_blank">...</a> J.D.
1. So what you use to show large amount of tabular data? 2. How did you get to conclusion that Search Engines doesn't like table structure?