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

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

This article mainly introduces the relevant information on the horizontal and vertical centering of the content of tabletablein 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 是所属的类*/ 

Copy after login

title

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

The above is to specify the id as class in p, then theattribute of tabletd 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!

Related labels:
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
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!