By default, the width and height of the table are automatically adjusted according to the content, and we can also manually set the width and height of the table.
Basic syntax<TABLE WIDTH=VALUE HEIGHT=VALUE>
Syntax explanationThe width of the table is defined by the WIDTH attribute, and the height of the table is defined by the WEIGHT attribute, in pixels or percentages. If it is a percentage, it can be divided into two situations: if it is not a nested table, then the percentage is relative to the browser window; if it is a nested table, then the percentage is relative to the cell width where the nested table is located.
File example: 10-3.htmSets the width and height of the table.
01 <!-- ------------------------------ -->
02 <!-- File example: 10-3.htm -->
03 <!-- File description: Set the width and height of the table-->
04 <!-- ------------------------------ -->
05 <HTML>
06 <HEAD>
07 <TITLE>Set the width and height of the table</TITLE>
08 </HEAD>
09 <BODY>
10 <H1>Mainstream web design software</H1>
11 <TABLE BORDER=1 WIDTH=400 HEIGHT=100>
12 <TR>
13 <TD>Web Image Software</TD><TD>Fireworks</TD>
14 </TR>
15 <TR>
16 <TD>Web page production 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 descriptionLine 11 defines the table width to be 400 pixels and the height to be 100 pixels.