table caption goes bottom using bootstrap

感情迁移 提交于 2019-12-08 15:01:14

问题


Table caption is at the top of the table but when I use a bootstrap class it goes to bottom of the table.

<table class="table table-bordered">
    <caption>why?</caption>
    <tr>
        <th>1</th>
        <th>2</th>
        <th>3</th>
    </tr>
    <tr>
        <th>4</th>
        <td>5</td>
        <td>6</td>
    </tr>
</table>

How do I align it to the top of table?


回答1:


That's because bootstrap 4 has default caption css style - caption-side: bottom

When you change caption-side: top; you will have your caption on the top of the table.



来源:https://stackoverflow.com/questions/48647942/table-caption-goes-bottom-using-bootstrap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!