运行代码 缩小
汉王
HTML代码
复制 格式化 注释 注释 清空
放大
AخA
 
1
<html>
2
<head>
3
<title>Table对象的属性</title>
4
</head>
5
<body>
6
<h2>Table对象的属性</h2>
7
<hr>
8
<table id="myTable" border=1>
9
<tr>
10
   <td>HTML</td>
11
   <td>CSS</td>
12
</tr>
13
<tr>
14
   <td>JavaScript</td>
15
   <td>VBScript</td>
16
</tr>
17
</table>
18
<form>
19
<input type="button" onclick="document.all[6].border=3;" value="边框尺寸">
20
<input type="button" onclick="myTable.frame='above';" value="只有上方边框">
21
<input type="button" onclick="myTable.cellPadding='10';" value="更改cellPadding">
22
<input type="button" onclick="myTable.cellSpacing='10';" value="更改cellSpacing">
23
</form>
24
</body>
25
</html>
CSS代码
复制 格式化 注释 注释 颜色 清空
放大
CSS代码...
x
 
1
JS代码
复制 格式化 注释 注释 清空
放大
JS代码...
xxxxxxxxxx
1
 
1
名称
JavaScript控制Table对象的属性
分类
网站常用
描述
JavaScript控制Table对象的属性,用JS控制是否显示表格的边框,是否显示上边框、更改cellPadding、更改cellSpacing等表格属性的参数。
收藏