I've seen a number of threads asking for this type of layout so I hope nobody minds if I post this example that i've coded as it should be useful to a lot of people.

The idea was to produce a table type layout where:

1) any column could be the longest depending on content. 2) different coloured columns with borders. 3) a header and footer. 4) the footer must sit at the bottom of the window unless the content is greater. Then the footer sits at the bottom of the document.

While most of these problems have been partially solved before, I have not seen a solution that fulfils all the requirements (although I expect other people have of course done this before).

Its been tested in ie5, ie5.5, ie6, mozilla 1.2 1.4, firebird 0.6.1, Opera7(slight problem with footer but nothing that notices) and netscape 6.2. (Opera 6 doesn't like it but its usable and code can be added to make it acceptable). I suspect older browsers will fall over when they see it, however there's about 90% of the market covered here anyway.

I don't have a mac to test on but I know it works on Mac Firebird and Mac Netscape 7, netscape 6 OS 9. (On Mac IE5.1 and Safari1.1.1 it works with the columns but they don't like the footer but the design is still perfectly usable. I'm sure theres a mac hack that would fix it as the code is quite simple anyway.)

If you think its any good or your interested in how it works then shout. If you think its rubbish then keep quiet. (I've only posted it here because I think it may be useful and there are no links to any site on the demo.)

It's commented out so feel free to use it.

Paul

carrotflowers
—
2003-12-18T19:03:58Z —
#2

You rock!

Dangermouse
—
2003-12-18T21:14:22Z —
#3

Good job :eek2:

jamesxv7
—
2003-12-18T21:26:48Z —
#4

Hi to all:

Great job Paul. Inspired in your layout I build mine. Check it here: http://www.ecodig.com/index_.php until I finish it. If any one want the code I will give it. I think it works in any platform.

dprantzalos
—
2003-12-19T21:29:19Z —
#5

Hmm, very nice.

Now, can you make it such that the min-width of the header (or 3 columns combined) totals 800px, AND if the browser is increased to a size larger, that the left & right nav columns increase too but not beyond 250 pixels each (max-width)? AND keep it cross-browser compatible?

If you do, I'll give you a great big kiss :eek2:

-jim

PaulOB
—
2003-12-19T21:37:26Z —
#6

If you do, I'll give you a great big kiss :eek2:

That's a reason not to do it

I could probably do it for mozilla but ie would need to be hacked to death. (which is probably the best thing for it lol).

Paul

dprantzalos
—
2003-12-19T22:32:55Z —
#7

Paul_O_B said:

That's a reason not to do it

I could probably do it for mozilla but ie would need to be hacked to death. (which is probably the best thing for it lol).

Paul

Ok, I challenge you! :eek: Do it!

Actually, if you could help me out, I'd pay you for it dude. I just posted a message in the trading post for a css/xhtml freelancer.

-jim

PaulOB
—
2003-12-21T16:16:44Z —
#8

Ok, I challenge you! :eek: Do it!

Haven't got the time at the moment I'm afraid I saw your post in trading post and it looks like you'll find somenone to do what you want ok.

No one else reading this thread will know what you are talking about, unless of course they have read your other thread

Your original thread was a bit lower down

It doesn't matter to me but you may miss some traffic from your original thread, which would have gone to the top of the list had you posted correctly.

Never mind eh

Paul

John_Colby
—
2003-12-22T17:04:19Z —
#13

Paul

Great - many thanks - looks great

vgarcia
—
2003-12-22T20:22:56Z —
#14

Thread stickied

jodmcc
—
2003-12-22T21:39:48Z —
#15

Paul,

I just caught what you were saying about the wrong thread. My Bad.

John

system
—
2003-12-26T19:29:37Z —
#16

Thanks very much for posting this template. I think the hardest part probably is figuring out browser compatibility. Could you elaborate on the various browser hacks, why they work, and why they're needed?

Mozilla and Opera7 support min-height which IE doesn't so for ie you have to use height alone.

Therefore ie will render the page at the height specified but if content is greater it will automatically expand unlike mozilla (and others) which will overflow. Therefore mozilla needs height auto which will let the height expand with the content but the min-height is still observed so we now have both browsers behaving the same. Obviously we need to hide the height auto from ie otherwise it will have no height to start with.

That's why we use the child selector (>) to hide the styles from IE as IE doesn't understand the child selector. End result=both browers happy

IE5 and ie5.5. (and ie6 in quirks mode) have a broken box model and include padding and borders inside the width of an element instead of adding it to the width as per the specs.

As this is only an ie problem we use the star selector (universal selector) hack which only IE parses when in fact it shouldn't. Therefore to give style just to ie you can use * html followed by the style and only ie will parse it.

The second part is the backslash which when it occurs in the middle of the property causes ie5 and 5.5. to stop parsing that part of the style and move on to the next bit. This allows us to pass the values to even up the fact that ie5 and ie5.5. aren't adding the borders/padding to the elements width as they should. We just add up whatever the total width should be and give that to ie5 and 5.5.

IE6 does'nt trip up on the backslash and so still reads the correct width and does understand the box model so again everyone is happy:)

IE has a bug in that it adds padding to content surrounding a float and when content extends passed the bottom of the float there is a 3 pixel jog that can't be reduced by normal means.

The solution is either to give the content a specified width (if at all possible) or give it a specified height. However if you want the height to be fluid then you can use 1% height remembering that ie will automatically expand that 1% to fit the content. Again we need to hide this from other browsers otherwise they will adhere to the 1% height and ruin the layout.

All the above hacks have been explained before and there are many links on the web so just do a search for these terms:simplified box model hack3 pixel jogstar selector bigchild selector hack

Also, any idea how it would display on older browsers?

I doubt it will display at all!

I have listed the browers it has been checke on so far and IE5 displays more or less perfectly and is about as old as I want to support.

However the best thing to do would be to use import for the css to hide it from older browsers such as NN4 and then set up a very simple style rule that will allow the pages to be viewed and read.

Again if you want to search on the web there are some 3 column layouts that do work for Netscape 4, but they are pretty basic.

I hope the above all makes sense but I've just rushed of off quickly and I didn't have time to find you the links (I'm not supposed to be on the computer right now as we have guests lol)