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

高洛峰
發布: 2017-03-28 09:47:29
原創
2764 人瀏覽過

這篇文章主要介紹了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中文網其他相關文章!

來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板