请问:怎么控制一个表格隐藏/显示???小妹盼望着大家的解答

我想做一个表格,里面放两个文本框,默认为隐藏,当用户选择"录入"后才将这个表格显示出来,此后如果点"取消"又能将这个表格隐藏起来!!谢谢大家~~~~
---------------------------------------------------------------

 1<div>层来进行控制   
 2\---------------------------------------------------------------   
 3  
 4<html>
 5<head>
 6<title>调试</title>
 7<script language="javascript">   
 8function HideObj(Obj)   
 9{   
10Obj.style.display = "none";   
11}   
12function ShowObj(Obj)   
13{   
14Obj.style.display = "";   
15}   
16</script>
17</head>
18<body>
19<table id="Tab">
20<tr>
21<td>这是表格内容</td>
22</tr>
23</table>
24<input onclick="HideObj(window.document.all.Tab);" type="button" value="隐藏表格"/>
25<input onclick="ShowObj(window.document.all.Tab);" type="button" value="显示表格"/>
26</body>
27</html>   
28\---------------------------------------------------------------   
29  
30给表格一个id 然后使用window.id.visiable=false;   
31  
32大概是这样子,可能其中有一两个单词没写得对!   
33\---------------------------------------------------------------   
34  
35用那按鈕調用一個function就行了﹐   
36<div id="text_div" style="display:none "> <input ```"="" name="reply_date" reply_date")="" size="18" type="text" value="```
37=request.form("/></div>
38<input name="check_new" onclick="showtext();" size="2" type="button" value="新增"/>   
39function showtext(){   
40if(text_div.style.display=="none")   
41{text_div.style.display="block";}   
42else{   
43text_div.style.display="none";}   
44}   
45\---------------------------------------------------------------   
46  
47<script>   
48<!--   
49function funa()   
50{   
51document.form1.all['D1'].innerHTML='<input name=T1 size=20>'+   
52'<br><input name=T2 size=20>';   
53}   
54function funb()   
55{   
56document.form1.all['D1'].innerHTML='';   
57}   
58//-->   
59</script>
60<form name="form1">
61<table>
62<tr>
63<td>
64<div id="D1"></div>
65</td>
66</tr>
67</table>
68</form>
69<input onclick="funa();" type="button" value="显示"/>
70<input onclick="funb();" type="button" value="隐藏"/>   
71\---------------------------------------------------------------   
72  
73可以设定个div,然后控制它可见还是不可见。。   
74也可以设定表格的id来可见或不可以。。   
75bananasmiling(hello找我) 很不错。。呵呵。。我是菜鸟,个人感觉。。   
76  
77\---------------------------------------------------------------   
78  
79<a href="#" onclick="javascript:t.style.display='block'">显示</a>
80<table id="t" style="display:none;">
81<tr>
82<td>   
83内容   
84</td>
85</tr>
86</table>   
87简单明了   
88\---------------------------------------------------------------   
89  
90obj.style.display ="";显示   
91obj.style.display ="none";隐藏</div>
Published At
Categories with Web编程
comments powered by Disqus