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表单的基本元素

js css文件怎么引入

Html换行代码是什么?

Html h1标签怎么居中?有关于Html中的h1居中实例解析

Html最外层元素是什么?

Html表格是?什么

Html和xml的区别分析

如何解决Html、body元的高度问题

Html ruby标签怎么用

Html的头部有什么元素

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




JavaScript 从入门到项目实践
书籍

JavaScript 从入门到项目实践

清华大学出版社

本书采取“基础知识→核心应用→核心技术→高级应用→行业应用→项目实践”的结构和“由浅入深,由深到精”的学习模式进行讲解。全书共35章,不仅介绍了HTML、CSS、对象、函数、事件等JavaScript语言的基础知识,而且深入介绍了jQuery、客户端、服务器端、数据存储等核心技术。



打赏

取消

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

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

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

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

评论

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