html中table表格的内容水平和垂直居中显示


本文摘自PHP中文网,作者不言,侵删。

这篇文章主要介绍了html中table表格的内容水平和垂直居中显示的相关资料,需要的朋友可以参考下

在CSS样式文件中指定

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

#class td /*设置表格文字左右和上下居中对齐*/

    vertical-align: middle;

    text-align: center; 

}

/*class 是所属的类*/

<p id="class" align="center" style= "margin: 0cm 0cm 0pt; text-align: left">                                                                     

<table class="table table-bordered" border="1" width="100%" style="font-size: 14pt; color: #000000; font-family: 楷体;mso-ascii-font-family: 'times new roman'; mso-hansi-font-family: 'times new roman'">                                                            

<caption><h2 style="text-align: left;font-size: 16pt;font-family: 宋体;color: red;">title</h2><

/caption>                                                             

<tbody >                                                                

<tr style="font-weight: bold;mso-bidi-font-size: 12.0pt;font-family: 宋体;" >                                                                     

<td>序号</td>                                                                     

<td>适用情况</td>                                                                     

 <td>详情</td>                                                                      

<td>备注</td>                                                                  

 </tr>                                                                                                                                      

<tr>                                                                   

<td>1</td>                                                                    

<td>xxxxx</td>                                                                     

<td style="text-align: left;"> <!--指定靠左对齐-->                                                                    

 <span>                                                                            

xxxxxx<br>                                                                                                                                                       

</span>                                                                     

</td>                                                                      

<td><a href="#">查看详情</a>

</td>                                                             

</tr>                                               

</tbody>                                                         

</table>

</p>

阅读剩余部分

相关阅读 >>

Html怎么跳转到指定位置

通过display或visibility来实现Html元素的显示与隐藏

详细介绍Html5中的新事件

Html中添加图片的代码是什么?Html如何正确的添加图片路径?

h5与传统Html的区别

Html 导出到 excel

Html的标签的应该怎样嵌套

浏览器内核以及浏览器兼容的问题分析

什么是Html h1标签?Html h1标签使用方法的详细介绍

Html如何给段落加粗

更多相关阅读请进入《Html》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...