Web Front-end
HTML Tutorial
The content of the table in HTML is displayed horizontally and vertically in the center
The content of the table in HTML is displayed horizontally and vertically in the center
This article mainly introduces the relevant information on the horizontal and vertical centering of the content of the table table in HTML. Friends in need can refer to the following
Specify in the CSS style file
#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 id="title">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>The above is to specify the id as class in p, then the attribute td of the table uses the style specified in css, as shown roughly in the figure

Related recommendations:
Html realizes the report effect of dynamically displaying color blocks (example code)
The above is the detailed content of The content of the table in HTML is displayed horizontally and vertically in the center. For more information, please follow other related articles on the PHP Chinese website!
Hot AI Tools
Undresser.AI Undress
AI-powered app for creating realistic nude photos
AI Clothes Remover
Online AI tool for removing clothes from photos.
Undress AI Tool
Undress images for free
Clothoff.io
AI clothes remover
AI Hentai Generator
Generate AI Hentai for free.
Hot Article
Hot Tools
Notepad++7.3.1
Easy-to-use and free code editor
SublimeText3 Chinese version
Chinese version, very easy to use
Zend Studio 13.0.1
Powerful PHP integrated development environment
Dreamweaver CS6
Visual web development tools
SublimeText3 Mac version
God-level code editing software (SublimeText3)
Hot Topics
1379
52
Table Border in HTML
Sep 04, 2024 pm 04:49 PM
Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.
HTML margin-left
Sep 04, 2024 pm 04:48 PM
Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.
Nested Table in HTML
Sep 04, 2024 pm 04:49 PM
This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.
HTML Table Layout
Sep 04, 2024 pm 04:54 PM
Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.
HTML Input Placeholder
Sep 04, 2024 pm 04:54 PM
Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.
HTML Ordered List
Sep 04, 2024 pm 04:43 PM
Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively
Moving Text in HTML
Sep 04, 2024 pm 04:45 PM
Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.
HTML onclick Button
Sep 04, 2024 pm 04:49 PM
Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.


