我没有太多运气使pageLinks表居中并且在pagingDiv div中右对齐goToPage div。我需要这两个元素位于同一垂直水平。任何帮助将不胜感激。
<div id="pagingDiv" style="border:1px solid black; width:100%;">
<table id="pageLinks" style="border:1px solid black; margin:auto;" >
<tbody>
<tr>
<td>
<a href="#first" title="Click to go to first page.">1</a>
</td>
<td>
<a href="#first" title="Click to go to second page.">2</a>
</td>
</tr>
</tbody>
</table>
<div id="goToPage" style="float:right"> Page 3 of 42 | Page#: <input style="height:14px;width:21px;" /> <a href="#go">GO</a></div>
</div>
答案 0 :(得分:1)
在HTML中的表格之前移动goToPage div:
<div id="pagingDiv" style="border:1px solid black; width:100%;">
<div id="goToPage" style="float:right"> Page 3 of 42 | Page#:
<input style="height:14px;width:21px;" /> <a href="#go">GO</a>
</div>
<table id="pageLinks" style="border:1px solid black; margin:auto;">
<tbody>
<tr>
<td> <a href="#first" title="Click to go to first page.">1</a>
</td>
<td> <a href="#first" title="Click to go to second page.">2</a>
</td>
</tr>
</tbody>
</table>
</div>
<强> jsFiddle example 强>