HTML table markup tutorial (16): Title Horizontal Alignment attribute align

Time:2022-6-12

By default, the title of the table is centered horizontally. We can set the horizontal alignment of the title text through the align attribute.
Basic grammar

<Caption ALIGN=”LEFT”>…</Caption>

<Caption ALIGN=”CENTER”>…</Caption>

<Caption ALIGN=”RIGHT”>…</Caption>

Grammatical interpretation

Left is left, center is center, and right is right.
Document example: 10-15 htm

Set the horizontal alignment of the table title through the align attribute of the <caption> tag.
01 <!– —————————— –>
02 <!– Document example: 10-15 htm –>
03 <!– File Description: set horizontal alignment of table title — >
04 <!– —————————— –>
05 <HTML>
06 <HEAD>
07 <title> set horizontal alignment of table titles </title>
08 </HEAD>
09 <BODY>
10 <TABLE BORDER=3 WIDTH=400 HEIGHT=100 Bordercolor=#336699 ALIGN=”CENTER”>
11 <caption align= “right” > mainstream web design software </caption>
12 <TR>
13 <td> web image software </td><td>fireworks</td>
14 </TR>
15 <TR>
16 <td> web page making software </td><td>dreamweaver</td>
17 </TR>
18 <TR>
19 <td> web animation software </td><td>flash</td>
20 </TR>
21 </TABLE>
22 </BODY>
23 </HTML>

Document description

Line 11 defines the right alignment of the table title text.

Recommended Today

JS accurate calculation

var numA = 0.1; var numB = 0.2; alert( numA + numB ); 0.1 + 0.2 = 0.30000000000000004。Calculation accuracy error problem (related to binary). For the four arithmetic operations of floating-point numbers, almost all programming languages will have the problem of similar precision error. However, methods have been encapsulated in c++/c\c\java to avoid the problem […]