I just want to say that you are misleading a bit about the behavior of div tags in the respective browsers... You describe 1 case where they are used in one way. The problem is that when you, as the developer, fail to properly format your divs, the browsers use defaults, and each browser is likely to have different defaults...
I have built some examples for a customer of mine whose in-house web designer, and I use the term loosly, only knew how to use tables to achieve his desired effect... BUT tables are not what they really need...
In my examples, I have several with different layouts, if the browser is resized to be smaller than the screen horizontally, scrollbars are shown just as users expect of browsers today...
First my examples are designed to automatically adjust between a range of "supported" sizes... if the browser goes over or under this size range, it take the max or min default setting and uses it... i.e. scrolls if needed... Just like this DaniWeb site, I have one with beveled edges to the sides of the content. I have one with beveled edges all around (left-right-top-bottom) including the corners which blend together so it "frames" the page, and I have one with top and bottom banner/menu bars which always stay on screen with beveled edges to the left and right and the document scrolls up-down between the banner/menus on the page... I have several more....
The total code to achieve these effects is a couple dozen lines, if that, including the resizing etc. and it represents something that can't be done with a table at all.... or at least not without some serious power coding... I don't like to say anything is impossible... the moment you do, someone comes along and does it....
In fact that was how I first fell in love with programming... When I was a kid in school, I asked my teacher how I could do something... I was learning to program back when you still had to load the bios on startup then load the dos and after 10 minutes of starting-up the machine you could start working, when we thought the addition of an an external 5.25 Inch floppy meant you were in serious business mode.... Anyway, he said I couldn't do it, he said computers just can't do that... I won't say what it is, but todays computers do it without qestion... Back then it was unheard of... I didn't like his answer so I decided to find a way to do it... My math teacher was moonlighting as a computer teach at the local college so I asked him for help figuring it out, within a week I had a working proto-type and the when the programming teacher saw it he just couldn't believe it...
The next year I was teaching his computer class while he taught physics in the next room... A short few years later the Mac was released and it could do, out of the box, what I had spent so much time trying to sort out...
The moral is, never say anything is impossible, just admit either YOU don't know how, or it could be done with a whole lot of work... In some cases the questions is, "Is there a better way?"... like using Tables for layout, there is ALWAYS a better way, you just might not know it yet...
But I admit, it is sometimes a quick way to do something and just get it done...
Peace,
Originally Posted by
MidiMagic
My thoughts:
- How much whitespace you use depends on how much content you want, vs how much you have to pay for server memory and download bandwidth.
- I use only one space for each indent in tight memory situations. But I use a monospace editor font.
- I have only one level of indentation for each table:
<table><tr>
<td>contents</td>
<td>contents</td>
<td>contents</td>
</tr><tr>
<td>contents</td>
<td>contents</td>
<td>contents</td>
</tr></table>
- I base my decision of whether to use tables or divs to format the page by how I want the page to fail it the browser window is too small:
-- When div is used with Mozilla, it overlaps the elements (especially images) on the screen when the browser window is too narrow.
-- When div is used with IE, it collapses the horizontally spaced elements into a vertical column when the browser window is too narrow.
-- When tables are used with either Mozilla or IE, a horizontal slide bar appears at the bottom of the screen, and the display is wider than than the window.
- I totally can't stand the variable name standards which originated with c (probably because I think C is one of the third worst programming language). I string together enough characters to do the job, e.g. digindx for digit index.
- I usually choose code to reflect the mix of browsers I expect to be using it, but I also realize that if I use deprecated code, I will have a big job to do later.