0

我在将 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"> &nbsp; Page 3 of 42 | Page#: <input style="height:14px;width:21px;" /> <a href="#go">GO</a></div>                  
</div>
4

1 回答 1

1

将 goToPage div 移到 HTML 中的表格之前:

<div id="pagingDiv" style="border:1px solid black; width:100%;">
    <div id="goToPage" style="float:right">&nbsp; 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 示例

于 2013-08-20T20:18:18.413 回答