冰冰超人是谁:如何用javascript控制表格?

来源:百度文库 编辑:高考问答 时间:2024/04/29 05:04:32
我想让表格的高度等于屏幕的高度,在javascript里有一个screen.height能取得当前屏幕的高度,但是我如何才能把这个值运用到表格里呢?
<script language=javascript>
var a=screen.height; //取得当前屏幕的高度
</script>

<table width="100%" height="这里的高度我想调设置成a=screen.height的值">
<tr>
<td></td>
</tr>
</table>
我该怎么做?或者在javascript里如何控制表格的一些数据?我刚学,不懂,请大家多多指教
二楼的朋友讲的不对吧,我使用的时候怎么不正确?

<SCRIPT language=JavaScript>
document.write("<table width='100%'");
document.write(" height="+a+"> ");
</SCRIPT>
<tr>
<td></td>
</tr>
</table>

运行正确阿。

<table width="100%" id=Table1>
<tr>
<td></td>
</tr>
</table>

<SCRIPT language=JavaScript>
document.all["Table1"].height = screen.height;
</SCRIPT>

那你还不如!
直接把屏幕的高度给属性height!