1

In my facelets template, there is div min-hight. It does't work in Firefox Browser.

    <div class="body">
        <table>
            <tr>
                <td valign="top" width="100%" style="min-height: 400px;">
                    <ui:insert name="body"/>
                </td>
            </tr>
        </table>

    </div>

What I need to do for these two browsers.

SJuan76
  • 24,532
  • 6
  • 47
  • 87
Zaw Than oo
  • 9,651
  • 13
  • 83
  • 131

3 Answers3

2

Try with

<td valign="top" width="100%" style="display:block; min-height: 400px;">

As feeela said, "min-height applies to block level and replaced elements"

Community
  • 1
  • 1
Giona
  • 20,734
  • 4
  • 56
  • 68
  • 1
    I think that's the correct answer. ["`min-height` applies to: block level and replaced elements"](https://developer.mozilla.org/en-US/docs/CSS/min-height) – feeela Sep 19 '12 at 09:10
  • Thanks i'll add it to the answer – Giona Sep 19 '12 at 09:12
0

use only height so it's work properly

  <div class="body">
     <table>
       <tr>
            <td valign="top" width="100%" style="height: 400px;">
                  <ui:insert name="body"/>
           </td>
      </tr>
  </table>
 </div>
Andrei Sfat
  • 8,440
  • 5
  • 49
  • 69
-1

As per the specification here (spec) min-height SHOULD not be applied to table elements. Therefore it is IE that is displaying this property wrong, not Firefox (no surprise there). What you can do is either stop using tables for layout (Which the standard reccomends) OR place a DIV within the table cell and apply the min height property to the div to force the TD to adopt its content size.

option 1:

<body>
    <div class="body" style="min-height:400px;">
        <ui:inser name="body"/>
    </div>
</body>

option 2:

<div class="body">
    <table>
        <tr>
            <td valign="top" width="100%">
                <div  style="min-height: 400px;">
                    <ui:insert name="body"/>
                </div>
            </td>
        </tr>
    </table>
</div>

The downsides of option 1 - Possibility of extra styling needed to get x-browser for legacy IE (6,7,8) The downsides of option 2 - unneccesary mark-up, non-standard.

Dpolehonski
  • 948
  • 6
  • 11
  • That's wrong. Spec states it should apply to all non-replaced inline elements: http://stackoverflow.com/a/14420691/1792090 Its a known bug in FF: https://bugzilla.mozilla.org/show_bug.cgi?id=307866 – unity100 Aug 15 '15 at 23:17