【发布时间】:2011-07-29 09:12:20
【问题描述】:
我正在尝试在我的网站上使用 div 创建一个类似表格的结构,但在使用边框时遇到了一些困难。我希望有一条水平线分隔每一行,但在设置为 table-row 的 div 上使用 border 似乎没有效果。我究竟做错了什么?感谢您的帮助!
<div class="table">
<div class="row">
<div class="cell">
<p>Blah blah</p>
</div>
<div class="cell">
<p>Blah blah</p>
</div>
<div class="cell">
<p>Blah blah</p>
</div>
</div>
</div>
.table {
display: table;
width: 100%;
}
.row {
display: table-row;
border-bottom: 1px solid black;
}
.cell {
display: table-cell;
width: 33%;
}
【问题讨论】:
标签: html