菜鸟求助:要隐藏table中指定的行
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <base href="<%=basePath%>"> <title>My JSP 'index.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> <script type="text/javascript"> function changeview(){ var target = document.getElementById("datas"); var targets = document.getElementsByName("") if(target.style.display == "none"){ target.style.display = ""; }else{ target.style.display = "none" } } </script> </head> <body> <table id="salereport" border="1" bordercolor="green" cellspacing="0" width="800px" > <tr align="center"> <td class="headline">地域</td> <td class="headline">电视</td> <td class="headline">手机</td> <td class="headline">电话</td> <td class="headline">冰箱 </td> <td class="headline">洗衣机</td> <td class="headline">电脑</td> </tr> <tr> <td><a href="javascript:void(0);" onclick="changeview();">重庆</a></td> <td>200</td> <td>400</td> <td>300</td> <td>500</td> <td>250</td> <td>700</td> </tr> <tr id="datas"> <td>    铜梁</td> <td >100</td> <td>200</td> <td>100</td> <td>400</td> <td>100</td> <td>500</td> </tr> <tr> <td>    奉节</td> <td>100</td> <td>200</td> <td>200</td> <td>100</td> <td>150</td> <td>200</td> </tr> </table> </body></html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <base href="<%=basePath%>"> <title>My JSP 'index.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> <script type="text/javascript"> function changeview(city){ var target = document.getElementById(city); if(target.style.display == "none"){ target.style.display = ""; }else{ target.style.display = "none" } } </script> </head> <body> <table id="salereport" border="1" bordercolor="green" cellspacing="0" width="800px" > <tr align="center"> <td class="headline">地域</td> <td class="headline">电视</td> <td class="headline">手机</td> <td class="headline">电话</td> <td class="headline">冰箱 </td> <td class="headline">洗衣机</td> <td class="headline">电脑</td> </tr> <tr> <td><a href="javascript:void(0);" onclick="changeview('congqing');">重庆</a></td> <td>200</td> <td>400</td> <td>300</td> <td>500</td> <td>250</td> <td>700</td> </tr> <tr id="congqing"> <td> <table> <tr> <td>    铜梁</td> <td >100</td> <td>200</td> <td>100</td> <td>400</td> <td>100</td> <td>500</td> </tr> <tr> <td>    奉节</td> <td>100</td> <td>200</td> <td>200</td> <td>100</td> <td>150</td> <td>200</td> </tr> </table> </td> </tr> </table> </body></html>
[解决办法]
哦, 那里的td里面要加上, colspan="7"
还有就是, 样式你要重新设置下,
------解决方案--------------------
tr css: display:none
[解决办法]
可以在functions(this)这个试试,可以通过this。getpartentNote来操作当前所选的tr对象