<html>
<style type="text/css">
.table { display: table;}
.tablerow { display: table-row; border:1px solid black;}
.tablecell { display: table-cell; }
</style>
<div class="table">
<div class="tablerow">
<div class="tablecell">Hello</div>
<div class="tablecell">world</div>
</div>
<div class="tablerow">
<div class="tablecell">foo</div>
<div class="tablecell">bar</div>
</div>
</div>
</html>
私の理解によると、tablerow クラスで指定した各行に黒い境界線を描画する必要があります。しかし、国境は出てきません。
そして、行の高さを変更したかったのです。「px」で指定すると動作します。しかし、 % -- を指定すると機能しません。次のことを試しました
.tablerow {
display: table-row;
border:1px solid black;
position: relative; //not affecting anything and the border disappears!!
//position: absolute; // if this is set,the rows overlaps and the border works
height: 40%; // works only if specified in px and not in %
}
どこかで何かがおかしくなっているのですが、どこか理解できません。助けてください!