By default, the width and height of the cell are automatically adjusted according to the content, and we can also manually set the width and height of the cell.
Basic syntax<TD WIDTH=value HEIGHT=value>
Syntax explanationThe width of the cell is defined by the WIDTH property, and the height of the cell is defined by the WEIGHT property, in pixels or percentages.
File example: 10-29.htmSets the width and height of the cell.
01 <!-- ------------------------------ -->
02 <!-- File example: 10-29.htm -->
03 <!--File description: Set the width and height of the cell-->
04 <!-- ------------------------------ -->
05 <HTML>
06 <HEAD>
07 <TITLE>Set the width and height of the cell</TITLE>
08 </HEAD>
09 <BODY>
10 <H1>Mainstream web design software</H1>
11 <TABLE BORDER=1 WIDTH=400 HEIGHT=100>
12 <TR>
13 <TD WIDTH=300 height=50>Web page 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. Line 13 defines the width of the cell to be 300 pixels and the height of 50 pixels.