由于jQuery 的 Sortable 存在一些细微差别,我在 HTML 中显示了一个表格元素,但使用 's 来创建列而不是 's (下面和在这个小提琴中):
<style>
/* Title row for an action/item */
.item-row {
display: table-row;
}
/* Keep icon columns narrow */
.icon_column {
display: table-cell;
width: 20px;
}
/* Item columns that are not icons */
.name_column {
display: table-cell;
}
.extra_column {
display: table-cell;
float: right;
}
</style>
<table class='table table-condensed'>
<thead>
<tr class='table_header'>
<th>
<div class='item-row'>
<span class='icon_column'>*</span>
<span class='icon_column'>*</span>
<span class='icon_column'>*</span>
<span class='name_column'>Name</span>
<span class='extra_column'>Date</span>
</div>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class='item_row'>
<span class='icon_column'>*</span>
<span class='icon_column'>*</span>
<span class='icon_column'>*</span>
<span class='name_column'>Name 1</span>
<span class='extra_column'>Date 1</span>
</div>
</td>
</tr>
<tr>
<td>
<div class='item_row'>
<span class='icon_column'>*</span>
<span class='icon_column'>*</span>
<span class='icon_column'>*</span>
<span class='name_column'>Row 2 Name 2</span>
<span class='extra_column'>Date 2</span>
</div>
</td>
</tr>
<tr>
<td>
<div class='item_row'>
<span class='icon_column'>*</span>
<span class='icon_column'>*</span>
<span class='icon_column'>*</span>
<span class='name_column'>Name 3</span>
<span class='extra_column'>Date 3</span>
</div>
</td>
</tr>
</tbody>
</table>
我希望每个项目行显示为一行,其中 extra_column 一直浮动到右侧。extra_column 似乎在右侧,但整个项目行似乎默认为两行。
如何更正此 CSS?</p>