給標簽設置text-align以及line-height屬性
如果line-height不加important的話,就不會垂直居中,因為table自帶的一些屬性會影響我們設置的line-height
<style> td, tr,th{ text-align: center; } td{ line-height: 34px !important; } </style>
效果如下:
給標簽設置text-align以及line-height屬性
如果line-height不加important的話,就不會垂直居中,因為table自帶的一些屬性會影響我們設置的line-height
<style> td, tr,th{ text-align: center; } td{ line-height: 34px !important; } </style>
效果如下:
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。