隐藏元素:Object.style.display=none
其他属性参考: http://www.w3school.com.cn/jsref/dom_obj_style.asp
方法只有一种。
步骤:
1、获取table的dom节点
2、通过js设置table的height属性
代码示例
<body><table id='test' border='1'> 定义一个table
<tr>
<td>111</td><td>222</td>
</tr>
</table>
<script>
var tb = document.getElementById('test')//获取table的dom节点
tb.setAttribute('height',300)//设置table高度为300
</script>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
</head>
<body>
<div id = "box"></div>
</body>
<script type="text/javascript">
var box = document.getElementById("box")
box.style.width='100px'
box.style.height='200px'
box.style.backgroundColor='red'
</script>
</html>