给你个例子
<div id="eyun" style="overflow:hidden;width:300">
<table border="1" style="font-size:9pt" width=1300>
<tr align="center">
<td width=100>心云意水1</td>
<td width=100>心云意水2</td>
<td width=100>心云意水3</td>
<td width=100>心云意水4</td>
<td width=100>心云意水5</td>
<td width=100>心云意水6</td>
<td width=100>心云意水7</td>
<td width=100>心云意水8</td>
<td width=100>心云意水9</td>
<td width=100>心云意水A</td>
<td width=100>心云意水B</td>
<td width=100>心云意水C</td>
<td width=100>心云意水D</td>
</tr>
</table>
</div>
<span onmouseover="ys('left')" onmouseout="n()" style="cursor:hand">Left</span>
<span onmouseover="ys('right')" onmouseout="n()" style="cursor:hand">Right</span>
<script language=JavaScript>
var Timer=null;
var t=10;
function n()
{clearTimeout(Timer)}
function ys(s)
{eyun.doScroll(s)
Timer=setTimeout("ys('"+s+"')",t)
}
</script>
<div id="eyun" style="overflow:hidden;width:300">
<table border="1" style="font-size:9pt" width=1300>
<tr align="center">
<td width=100>心云意水1</td>
<td width=100>心云意水2</td>
<td width=100>心云意水3</td>
<td width=100>心云意水4</td>
<td width=100>心云意水5</td>
<td width=100>心云意水6</td>
<td width=100>心云意水7</td>
<td width=100>心云意水8</td>
<td width=100>心云意水9</td>
<td width=100>心云意水A</td>
<td width=100>心云意水B</td>
<td width=100>心云意水C</td>
<td width=100>心云意水D</td>
</tr>
</table>
</div>
<span onmouseover="ys('left')" onmouseout="n()" style="cursor:hand">Left</span>
<span onmouseover="ys('right')" onmouseout="n()" style="cursor:hand">Right</span>
<script language=JavaScript>
var Timer=null;
var t=10;
function n()
{clearTimeout(Timer)}
function ys(s)
{eyun.doScroll(s)
Timer=setTimeout("ys('"+s+"')",t)
}
</script>
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<script language="JavaScript">
<!--
/*********************
help:
tab.rows.length : 得到表格中的行数
tab.rows[i].cells.length :得到表格中一行的列数
tab.rows[i].cells[j]: 得以表格中指定行列的对象.
*********************/var num = 5; //显示表格的列数,可自行更改
var cont = 0; //记录当行隐藏的列数,不能动 :)
function init() //初始化函数,控制要显示的表格列数
{
for(var i=0;i<tab.rows.length;i++)
{
for(j=0;j<tab.rows[i].cells.length;j++)
{
if(j>num-1)
{
tab.rows[i].cells[j].style.display = "none";
}
}
}
}function kiss(flag)
{
if(flag=="right")
{
for(var i=0;i<tab.rows.length;i++) //显示后一列数据
{
for(j=0;j<tab.rows[i].cells.length;j++)
{
if(j==num+cont)
{
tab.rows[i].cells[j].style.display = "";
}
}
}
if(num+cont<tab.rows[0].cells.length) //隐藏前一条数据
{
for(var i=0;i<tab.rows.length;i++)
{
for(j=0;j<tab.rows[i].cells.length;j++)
{
if(j==cont)
{
tab.rows[i].cells[j].style.display = "none";
}
}
}
cont+=1;
}
}
else
{
for(var i=0;i<tab.rows.length;i++) //显示前一列数据
{
for(j=0;j<tab.rows[i].cells.length;j++)
{
if(j==cont && j>0)
{
tab.rows[i].cells[j-1].style.display = "";
}
}
}
if(cont>0)
{
for(var i=0;i<tab.rows.length;i++) //隐藏后一列数据
{
for(j=0;j<tab.rows[i].cells.length;j++)
{
if(j==num+cont-1)
{
tab.rows[i].cells[j].style.display = "none";
}
}
}
cont-=1;
}
}
}
//-->
</script>
</head><body bgcolor="#FFFFFF" onload="init()">
<table id="tab" border="1" width="700">
<tr>
<td>11111111</td>
<td>22222222</td>
<td>33333333</td>
<td>44444444</td>
<td>55555555</td>
<td>66666666</td>
<td>77777777</td>
<td>88888888</td>
</tr>
<tr>
<td>11111111</td>
<td>22222222</td>
<td>33333333</td>
<td>44444444</td>
<td>55555555</td>
<td>66666666</td>
<td>77777777</td>
<td>88888888</td>
</tr>
<tr>
<td>11111111</td>
<td>22222222</td>
<td>33333333</td>
<td>44444444</td>
<td>55555555</td>
<td>66666666</td>
<td>77777777</td>
<td>88888888</td>
</tr>
</table>
<button onclick="kiss('left')"> <<< </button><button onclick="kiss('right')"> >>> </button>
</body>
</html>
<div id="eyun" style="overflow:hidden;width:300">
<table border="1" style="font-size:9pt" width=1300>
<tr align="center">
<td width=100>心云意水1</td>
<td width=100>心云意水2</td>
<td width=100>心云意水3</td>
<td width=100>心云意水4</td>
<td width=100>心云意水5</td>
<td width=100>心云意水6</td>
<td width=100>心云意水7</td>
<td width=100>心云意水8</td>
<td width=100>心云意水9</td>
<td width=100>心云意水A</td>
<td width=100>心云意水B</td>
<td width=100>心云意水C</td>
<td width=100>心云意水D</td>
</tr>
</table>
</div>
<span onclick="ys('left')" style="cursor:hand">Left</span>
<span onclick="ys('right')" style="cursor:hand">Right</span>
<script language=JavaScript>
function ys(s)
{eyun.doScroll(s)}
</script>
<head>
<style type="text/css">
body {background-color:#ffffff;}
#divMenu a {color:#999999; text-decoration:underline;}
#divMenu a:hover {color:#333333; text-decoration:underline;}
#divBg {position:absolute; z-index:10; width:2000px; left:0px; height:100px; clip:rect(0px 10px 10px 0px); visibility:hidden;}
#divMenu {position:absolute; z-index:11; left:11px; top:1px; color:#333333; font-size:13px; font-family:verdana,arial,helvetica,sans-serif; visibility:inherit;}
#divArrowLeft {position:absolute; z-index:12; width:11px; height:20px; left:0px; top:0px; visibility:inherit;}
#divArrowRight {position:absolute; z-index:12; width:11px; height:20px; top:0px; visibility:inherit;}
</style>
<script language="JavaScript" type="text/javascript">
function Area(msg){
parent.form1.Area1.value=msg;
parent.form1.submit();
}
var currentTopLeftMenu=0;
function moveMenuFun(moveNum)
{
var munuTotal=menuTr.cells.length-2;
if( moveNum>0 && currentTopLeftMenu*1+6<munuTotal )
{
menuTr.cells[1+currentTopLeftMenu].style.display='none';
menuTr.cells[currentTopLeftMenu+1+6].style.display='';
currentTopLeftMenu++;
}
if( moveNum<0 && currentTopLeftMenu>0 )
{
menuTr.cells[currentTopLeftMenu].style.display='';
menuTr.cells[currentTopLeftMenu*1+6].style.display='none';
currentTopLeftMenu--;
}
}
</script>
<title>Budget</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="http://luenfai-deve.smartdotweb.com/weicheng/css.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="1" bgcolor="AAA9A8"></td>
</tr>
</table></td>
<td >
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr id=menuTr>
<td width="58" height="25"><img src="http://luenfai-deve.smartdotweb.com/weicheng/images/main_r2_c2.gif" width="58" height="25" onclick="moveMenuFun(-1)"></td>
<td background="http://luenfai-deve.smartdotweb.com/weicheng/images/main_r2_c12.gif" class="td2"><font color="FFC332"><strong> 中国人民银行1</strong> </font></td>
<td background="http://luenfai-deve.smartdotweb.com/weicheng/images/main_r2_c12.gif" class="td2"><font color="FFC332"><strong> 中国人民银行2</strong> </font></td>
<td background="http://luenfai-deve.smartdotweb.com/weicheng/images/main_r2_c12.gif" class="td2"><font color="FFC332"><strong> 中国人民银行3</strong> </font></td>
<td background="http://luenfai-deve.smartdotweb.com/weicheng/images/main_r2_c12.gif" class="td2"><font color="FFC332"><strong> 中国人民银行4</strong> </font></td>
<td background="http://luenfai-deve.smartdotweb.com/weicheng/images/main_r2_c12.gif" class="td2"><font color="FFC332"><strong> 中国人民银行5</strong> </font></td>
<td background="http://luenfai-deve.smartdotweb.com/weicheng/images/main_r2_c12.gif" class="td2"><font color="FFC332"><strong> 中国人民银行6</strong> </font></td>
<td background="http://luenfai-deve.smartdotweb.com/weicheng/images/main_r2_c12.gif" class="td2" style="display:none"><font color="FFC332"><strong> 中国人民银行7</strong> </font></td>
<td background="http://luenfai-deve.smartdotweb.com/weicheng/images/main_r2_c12.gif" class="td2" style="display:none"><font color="FFC332"><strong> 中国人民银行8</strong> </font></td>
<td background="http://luenfai-deve.smartdotweb.com/weicheng/images/main_r2_c12.gif" class="td2" style="display:none"><font color="FFC332"><strong> 中国人民银行9</strong> </font></td>
<td width="57"><img src="http://luenfai-deve.smartdotweb.com/weicheng/images/main_r2_c14.gif" width="57" height="25" onclick="moveMenuFun(1)"></td>
</tr>
</table>
</td>
<td width="15%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="1" bgcolor="AAA9A8"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>