1. 程式人生 > >Bootstrap table th td 實現文字垂直居中

Bootstrap table th td 實現文字垂直居中

直接複寫th、td的樣式,樣式程式碼如下(外聯):

.table th, .table td {
text-align: center;
vertical-align: middle!important;
}

也可直接寫在html的th, .table, td標籤的style中,如下:


<th style="vertical-align: middle !important;text-align: center;">xxx</th>


<td style="vertical-align: middle !important;text-align: center;">xxx</td>

這樣就能達到水平且垂直居中的效果了

歡迎志趣相投的朋友一起學習交流!
本人qq:906570770
技術資料分享群:272811256(本人收集的資料免費分享,也是技術交流學習的好去處)