【发布时间】:2017-07-31 20:25:52
【问题描述】:
我正在创建一个比较表,其中的列构建如下:
<div id = "wrapper">
<div id = "col1">
<div class = "row1">
text
lots more text
and more text
</div>
<div class = "row2">
text
</div>
<div class = "row3">
text
</div>
</div>
<div id = "col2">
<div class = "row1">
text
</div>
<div class = "row2">
a
lot
of
text
</div>
<div class = "row3">
text
</div>
</div>
</div>
Col1 和 col2 然后显示为 inline-block,因此它们在页面上视觉上是相邻的。
问题是每一行的内容可能不同。如果不设置每行的最小高度,我如何确保每行在视觉上与另一列的对应行对齐?
我想不出任何方法可以单独在 CSS 中实现这一点。我想知道是否有一些偷偷摸摸的 jQuery 方法来实现这一点?
编辑:我无法更改 HTML 结构。
【问题讨论】:
标签: jquery css alignment css-tables