<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>
Theo tôi hiểu, một đường viền màu đen sẽ được vẽ trên mỗi hàng mà tôi đã chỉ định qua lớp tablerow.Nhưng đường viền không xuất hiện.hiển thị css: bảng không hiển thị đường viền
Và tôi muốn thay đổi chiều cao của một row.If tôi xác định nó với 'px' - đó work.But, nếu tôi cho nó với một% - sẽ không work.I thử như sau
.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 %
}
Đã xảy ra sự cố ở đâu đó nhưng tôi không thể hiểu được ở đâu. Hãy giúp tôi!
Bạn đã thử xác định biên giới cho các yếu tố tế bào? hoặc là nó không phải là những gì bạn muốn? –