我知道这里已经有很多问题了,但没有一个解决方案实际适用于我的特殊情况。这是布局的样子,而不对垂直居中任何修复:http://jsfiddle.net/4FsKG/9/如何垂直居中放置此内容?
这是TR#工具栏:高度和的line-height设置为2.25em:http://jsfiddle.net/4FsKG/10/。这集中了所有内容,但是我的页码周围的边框会导致出现间隙,您可以在左侧的边框下方便地看到这个间隙。此外,边框占据了单元格的整个高度,而不是像预期的那样围绕数字。
我已经尝试了许多其他的解决方案,但所有这些解决方案都以我已经展示的两个示例的一些变体而告终。
我希望行中的所有内容都是垂直居中的,同时允许我在页面编号之类的东西周围添加边框。有人有主意吗?
我的例子中的CSS:
table {
background-color:#274F68;
font-size:0.85em;
white-space:nowrap;
border-collapse:separate;
border:1px solid #274F68;
border-radius:6px 6px 6px 6px;
-moz-border-radius:6px 6px 6px 6px;
-webkit-border-radius:6px 6px 6px 6px;
}
tr#input td { border-bottom:2px solid #6189A3; }
tr#input td form {
float:right;
}
tr#toolBar {
font-family:Arial;
background-color:#152939;
color:#6189A3;
}
tr#toolBar td { border-bottom:2px solid #6189A3; }
tr#toolBar td a {
padding:0;
margin:0 3px 0 3px;
}
.dataTables_length { float:left;}
.dataTables_info { float:left; }
.dataTables_filter { float:right; }
.dataTables_paginate { float:right; }
.paging_full_numbers a.paginate_button,
.paging_full_numbers a.paginate_active {
float:left;
border: 1px solid #6189A3;
}
你有没有试过这样做没有表? – Jason
@Jason我没有。我考虑将这些部分移出表格,但那会有一个很大的缺点:我必须明确定义我的表格宽度。 – Kittoes0124
问题是你的页码在顶部和底部有一个边框,但是你那一行的其他元素没有。 – Jason