1

Is there as way to replicate exactly this layout without table (using CSS and divs only, no Javascript) in IE8:

http://jsfiddle.net/u0u7snh6/2/

I've tried multiple scenarios and IE8 seems to be either messing:

  • Height of the content cell
    • Either there height doesn't use 100% of the space available
    • Either the height uses more than 100% and cause overflow that cannot be removed
  • Alignment of the content cell

The word exactly is very important here... anything other than this layout will not work and IE8 is mandatory.

Otherwise, is using tables for layout a big deal in 2014?

Here is the simple code:

HTML

<body>
<table id="contentFrame">
    <tr style="background-color: pink;">
        <td>&nbsp;</td>
        <td id="contentCol">
            This is the header
        </td>
        <td>&nbsp;</td>
    </tr>
    <tr id="contentRow">
        <td></td>
        <td id="contentCell">
            This is the content
        </td>
        <td></td>
    </tr>
    <tr style="background-color: yellow;">
        <td></td>
        <td>
            This is the footer
        </td>
        <td></td>
    </tr>
</table>
</body>

CSS

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

#contentFrame {
    width: 100%;
    height: 100%;
    border-spacing: 0;
    border-collapse: collapse;
    empty-cells: show;
}

#contentRow {
    background-color: green;
}

#contentCell {
    height: 100%;
    vertical-align: middle;
    background-color: white;
}

#contentCol {
    width: 80%;
}
Nicolas Bouvrette
  • 4,295
  • 1
  • 39
  • 53
  • I thought windows dropped support for IE8? – Josh Crozier Aug 30 '14 at 17:47
  • 1
    Have you made an attempt and have specific issues with it? – CBroe Aug 30 '14 at 17:49
  • 2
    And how is this significantly different from your question just 2 hours earlier? [Header/Footer Layout with 100% Content Height in IE8](http://stackoverflow.com/questions/25583701/header-footer-layout-with-100-content-height-in-ie8) – CBroe Aug 30 '14 at 17:50
  • IE8 is only there on Windows XP. A lot of companies are stuck with Windows XP and thus, IE8... that's why I need to support it for a specific project. – Nicolas Bouvrette Aug 30 '14 at 17:54
  • Tables should be used to present tabular data and not full website layouts - [LINK](http://webmasters.stackexchange.com/questions/6036/why-arent-we-supposed-to-use-table-in-a-design/6037) – Anonymous Aug 30 '14 at 17:55
  • I have made several attemps - I tried to ask this other question and didn't manage to get any answers (based on my attempt): http://stackoverflow.com/questions/25583701/header-footer-layout-with-100-content-height-in-ie8. So I thought I would try to ask an open question instead. – Nicolas Bouvrette Aug 30 '14 at 17:56
  • I agree that using table for a layout is not ideal but I was unable to find a better solution, hence why I am here :) – Nicolas Bouvrette Aug 30 '14 at 17:56
  • In 2014 instead of table's layout use HTML5 (NEW) tags - `
    ` `
    – Anonymous Aug 30 '14 at 18:03
  • I already use HTML5 in my other example (and HTMLShiv for IE8). The problem is really that the
    doesn't not play nice in IE8, even if I pick 'display: table'. I've tried several options and got the problems mentioned in the top of my question :(
    – Nicolas Bouvrette Aug 30 '14 at 18:07
  • 2
    IE8 has been deprecated for at least 2 years now, unless you're working on an ATM interface... – Stubbies Aug 30 '14 at 18:07
  • I'm fine with the concept of deprecation and all. Unfortunately for this specific project I need to support both IE8 users and Blackberries which makes it a bit tricky if you also want to implement a responsive design. Having this simple layout would solve a lot of problem... considering the responses I think I'll stick to the tables since it works perfectly :) – Nicolas Bouvrette Aug 30 '14 at 18:09
  • It's hard to explain... maybe check my original question from earlier today for details on the IE8 misbehaviors with "table divs": http://stackoverflow.com/questions/25583701/header-footer-layout-with-100-content-height-in-ie8 – Nicolas Bouvrette Aug 30 '14 at 18:15
  • TRY - [DEMO](http://jsfiddle.net/7b686k17/1/) and use min-width and max-width instead of `width % values` and use CSS [@media-queries](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries) – Anonymous Aug 30 '14 at 18:23
  • Learn More: Mozilla MDN [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML) & [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) and Good Luck! :) – Anonymous Aug 30 '14 at 18:33
  • Ok thanks for the demo but what I'm trying to do is actually have the following elements: header row (full row + content which is centered with the content), content row (again centered with the header), footer similar to the header... both the header and footer must be able to adjust their height dynamically while the content's height will always take the rest of the space. That's why a 9x9 table seems the easiest solution for this problem (HTML5 wasn't able to help) – Nicolas Bouvrette Aug 30 '14 at 18:33
  • tell me the min-width, max-width, height, background-color and position of each elements??? – Anonymous Aug 30 '14 at 18:38

0 Answers0