首頁  >  文章  >  web前端  >  html中table表格的內容水平和垂直居中顯示實例程式碼

html中table表格的內容水平和垂直居中顯示實例程式碼

高洛峰
高洛峰原創
2017-03-28 09:47:292778瀏覽

這篇文章主要介紹了html中table表格的內容水平和垂直居中顯示的相關資料,需要的朋友可以參考下

 在CSS樣式檔案中指定

#class td /*设置表格文字左右和上下居中对齐*/ 
{  
    vertical-align: middle;
    text-align: center;  
}
/*class 是所属的类*/
<p>                                                                      
</p>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

title

                                                              
序号适用情况详情备注
1xxxxx                                                                                                                                                      xxxxxx
                                                                                                                                                        
                                                                      
查看详情
 

上述是在p指定id為class,則其中table的屬性td使用的就是css中指定的樣式,大致如圖所示

html中table表格的內容水平和垂直居中顯示實例程式碼

#

以上是html中table表格的內容水平和垂直居中顯示實例程式碼的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn