views:

67

answers:

2

Hello,

Column B in the layout below appears wrong. I managed to make a 3 columns layout using http://www.dynamicdrive.com/style/layouts/item/css-liquid-layout-31-fixed-fluid-fixed/. However, this assumes that the fixed columns A and B have the same height/have the same vertical starting point. In my case B has another fluid div above.

alt text

I don't know how to make column B. Can anyone help?

Thank you!

Update:

I am trying to use display: table and display: table-cell but is not working on IE8. It works on Firefox.

<html>
    <head>
    </head>
    <body>
        <div style="display: table">
            <div style="display: table-cell">
                Column 1
            </div>
            <div style="display: table-cell">
                Column 2
            </div>
        </div>
    </body>
</html>

Even later edit:

In order to make the code above work on IE8 you need to add:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
+2  A: 

There are 4 ways to do it:

  1. Faux columns. Basically trick the user into thinking the columns go down to the bottom of the page by creating a wrapper and giving it a background image with a divider. In your case, for a fluid layout, you'd have to do it twice and use a left-aligned bg image once, and a right-aligned one the other time.

  2. The "One True Layout". This is a rather ugly hack that works by specifying a huge bottom padding as well as a negative bottom margin, then hiding the overflow. It works fairly well in practice, but has a lot of small problems, such as no way of applying bottom borders (see the link for a full list).

  3. Use a wrapper with display: table and give the columns a display: table-cell. I have read that this works in most browsers, but haven't tried this myself, so no guarantees.

  4. Go back to tables. CSS is semantically great and all, but sometimes you have no choice but to sacrifice machine semantics for a decent user experience.

Max Shawabkeh
Unless I've misinterpreted the question I don't think the heights of all columns equating to an equal rectangle is what he desires, meaning that this can be achieved without the use of the above?
Steve
I may have mistaken then intent (it's unclear), but from the question and image it sounds like any of the 4 suggestions above would work, since the two of the columns (center and right in this case) are typically in a wrapper, which can have a header applied without breaking the rest of the layout.
Max Shawabkeh
I am using solution 2 and, finally, I did the layout but it looks bad on IE. :( Will try 3 now. If is not working I'm going back to tables
Victor Hurdugaci
@Max: Solution 3 is not working. See the update in question.
Victor Hurdugaci
1. What the IE problem with #2? Perhaps that'll be easier to fix. There's not much to do about #3 since it's either supported or not. 2. Perhaps you could do a faux column between the left column and a wrapper, then do an OTL for the center and right columns inside the wrapper. Myself, I usually end up going for faux columns; you trade a little flexibility but it keeps the code much cleaner.
Max Shawabkeh
I manged to fix 3. Is working well now. The solution is now in the initial question.
Victor Hurdugaci
+1  A: 

The logical process for doing this would be to remove B from its current position on the DD Template.

Have the central div stretch to take up the additional space created.

Within that have your extra fluid div that you desire.

Then beneath that have another div and within that your fluid div and B.

Steve
That's what I'm doing. However the result is not good. Now I manged to do something but it looks bad on IE.
Victor Hurdugaci