<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’指定它--它可以工作.但是,如果我给它一个%--不会起作用.我try 了以下方法
.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 %
}
哪里出了问题,但我不知道哪里出了问题.请帮帮我!