如何隐藏表格的最后两列?谢谢
如题
------解决方案--------------------html文件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> 无标题文档 </title>
</head>
<body>
<table width= "600 " border= "2 " cellpadding= "0 " cellspacing= "0 " id= 'showr '>
<tr>
<td> a </td>
<td> b </td>
<td> c </td>
<td> d </td>
<td> e </td>
<td> f </td>
<td> g </td>
<td> h </td>
</tr>
<tr>
<td> 1 </td>
<td> 2 </td>
<td> 3 </td>
<td> 4 </td>
<td> 5 </td>
<td> 6 </td>
<td> 7 </td>
<td> 8 </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
<SCRIPT LANGUAGE= "JavaScript ">
<!--
var usertable= "showr ";
//-->
</SCRIPT>
<SCRIPT LANGUAGE= "JavaScript " src = "movement_table.js "> </SCRIPT>
</html>
js文件movement_table.js
//javascript
//write by aya
//2007-04-20
//给所要实现动态的表格添加一个id值,并在HTML文件中建立var usertable= " "变量,把该table的id值,赋值给usertable变量
var oPopup = window.createPopup();
var flag=0 ;
var heighter=0;
var widther= 120;
mtable=document.getElementById(usertable);
mtable.rows[0].oncontextmenu = function (table){
right_click(mtable);
return false;
}
function right_click(submenu){
if(!flag)
{
analyse_tab(usertable);
flag=1;
}
var lefter = event.x-20;
var topper = event.y-20;
var menu= document.getElementById( 'menu ');
oPopup.document.body.innerHTML = menu.innerHTML;
oPopup.show(lefter,topper,widther,heighter,submenu);
}
function analyse_tab()
{
table=document.getElementById(usertable);