<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的指定行繪製class.But邊境犯規上來。CSS顯示:表中未顯示邊框
,我想改變row.If我「PX」指定它的高度 - 它work.But,如果我用%給它 - 不會幹活嘗試以下
.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 %
}
某處出了問題,但我無法理解在哪裏。請幫忙!
你試過指定邊界的電池元件?或者它不是你想要的? –