Example code for horizontally and vertically centered display of the content of a table in HTML

高洛峰
Release: 2017-03-28 09:47:29
Original
2756 people have browsed it

This article mainly introduces the relevant information on the horizontal and vertical centering of the content of tabletable in html. Friends who need it can refer to the following

Specify in the CSS style file

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

title

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

The above is to specify the id as class in p, then the attribute of table td uses the style specified in css, as shown roughly in the figure

Example code for horizontally and vertically centered display of the content of a table in HTML

The above is the detailed content of Example code for horizontally and vertically centered display of the content of a table in HTML. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!