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如何实现tab页面切换

Html如何空格

javascript中对Html中元素属性的读取

Html怎样重定向连接

Html中如何调用javascript文件

Html语义化的含义和意义是什么

Html中的注释怎么写?Html中的注释符号又是什么?(附实例)

Html中一个表单由什么组成

Html内容的位置怎么调

Html hgroup标签怎么用

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




打赏

取消

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

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

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

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

评论

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