I have three βpanelsβ laid out along a series of tables. One is taller than the other two, and I want all three panels to match the height of the tallest. I tried styling divs with a height of: 100%, but short panels remain short even when the tds content grows.
My HTML is generated by JSF, so I have limited control over its form, but I can change the styles. I made a simplified version of the generated code below. The same problem occurs in IE8 and Firefox. However, IE8 displays short panels vertically aligned at the top of td, while Firefox does them in the middle.
<html> <head> <title>Test Table</title> <style TYPE="text/css"> td {border: 1px solid red; padding: 1px;} .panel {border: 1px solid blue; padding: 1px;height:100%} .panel-header{background-color: green; color: white;} .panel-body {border: 1px solid green; padding: 1px; height:100%;} </style> </head> <body> <h1>Test Table</h1> <table width="100%"> <tbody> <tr> <td> <div class="panel" style="height:200px;"> <div class="panel-header"> Header One </div> <div class="panel-body"> Body One </div> </div> </td> <td> <div class="panel" style="height:100%;"> <div class="panel-header"> Header Two </div> <div class="panel-body"> Body Two </div> </div> </td> <td> <div class="panel"> <div class="panel-header"> Header Three </div> <div class="panel-body"> Body Three </div> </div> </td> </tr> </tbody> </table> </body> <html>
Greg Charles
source share