By default, the width and height of the table are automatically adjusted according to the content. We can also set the width and height of the table manually.
Basic Grammar
语法解释
通过WIDTH属性定义表格的宽度,HEIGHT属性定义表格的高度,单位是像素或百分比。如果是百分比,则可分为两种情况:如果不是嵌套表格,那么百分比是相对于浏览器窗口而言;如果是嵌套表格,则百分比相对的是嵌套表格所在的单元格宽度。
文件范例:10-3.htm
设定表格的宽度和高度。
01
02
03
04
05
06
07 设定表格的宽度和高度
08
09
10 主流的网页设计软件
11
12
13 网页图像软件 |
Fireworks |
14
15
16 网页制作软件 |
Dreamweaver |
17
18
19 网页动画软件 |
Flash |
20
21
Grammar explanation
The width of the table is defined by the WIDTH attribute, and the height of the table is defined by the HEIGHT 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, the percentage is relative to the width of the cell where the nested table is located.
File example: 10-3.htm
Set the width and height of the table.
01 02 03 04 05 06 07 Set the width and height of the table 08 09 10 Mainstream web design software
11 12 13 Web image software |
Fireworks | 14
15 16 Webpage production softwareDreamweaver | 17
18 19 Webpage animation software |
Flash | 20
21
22 23
File Description
Line 11 defines the width of the table to be 400 pixels and the height to be 100 pixels.