Colspan / Rowspan用于显示设置为table-cell的元素 [英] Colspan/Rowspan for elements whose display is set to table-cell
本文介绍了Colspan / Rowspan用于显示设置为table-cell的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下代码:
<div class="table">
<div class="row">
<div class="cell">Cell</div>
<div class="cell">Cell</div>
</div>
<div class="row">
<div class="cell colspan2">Cell</div>
</div>
</div>
<style>
.table {
display: table;
}
.row {
display: table-row;
}
.cell {
display: table-cell;
}
.colspan2 {
/* What to do here? */
}
</style>
很简单。如何为 display:table-cell
?
推荐答案
据我所知,缺少colspan / rowspan只是 display:table
的限制之一。查看此信息:
As far as I know, the lack of colspan/rowspan is just one of the limitations of display:table
. See this post:
http ://www.onenaught.com/posts/201/use-css-displaytable-for-layout
这篇关于Colspan / Rowspan用于显示设置为table-cell的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文