类拟EXCEL表格锁定的功能的实现!



df 类拟EXCEL表格锁定的功能的实现!_第1张图片
上面为效果图,左右滚动时,标题栏也滚动!
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
< HTML >< HEAD >< TITLE ></ TITLE >
< META  http-equiv =Content-Type  content ="text/html; charset=gb2312" >
< META  content ="MSHTML 6.00.3790.2577"  name =GENERATOR >
< META  content =http://schemas.microsoft.com/intellisense/ie5 
name =vs_targetSchema ></ HEAD >
< BODY >< FONT  face =宋体 ></ FONT >
< SCRIPT >
        
function doscrollv(obj1)
        
{
            setTimeout(
"Div2.scrollLeft="+obj1.scrollLeft.toString(),1);
            setTimeout(
"Div1.scrollTop="+obj1.scrollTop.toString(),1);
            
return false;
        }

        
</ SCRIPT >

< TABLE  cellSpacing =0  cellPadding =0  width =350  border =0 >
  
< TBODY >
  
< TR >
    
< TD  width =100  height =30 ></ TD >
    
< TD >
      
< DIV  id =Div2  style ="OVERFLOW: hidden; WIDTH: 300px; HEIGHT: 30px" >
      
< TABLE  id =table2  height =30  cellSpacing =1  cellPadding =1  width =720 
        
border =0 >< TBODY >
        
< TR >
          
< TD  noWrap width =100  bgColor =#999999 >< FONT 
            
color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  noWrap width =100  bgColor =#999999 >< FONT 
            
color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  noWrap width =100  bgColor =#999999 >< FONT 
            
color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  noWrap width =100  bgColor =#999999 >< FONT 
            
color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  noWrap width =100  bgColor =#999999 >< FONT 
            
color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  noWrap width =100  bgColor =#999999 >< FONT 
            
color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  noWrap width =120  bgColor =#999999 >< FONT 
            
color =#ffffff >< B > asdf </ B ></ FONT ></ TD ></ TR ></ TBODY ></ TABLE ></ DIV ></ TD ></ TR >
  
< TR >
    
< TD  width =100 >
      
< DIV  id =Div1  style ="OVERFLOW: hidden; WIDTH: 100px; HEIGHT: 200px" >
      
< TABLE  id =Table1  cellSpacing =1  cellPadding =1  border =0 >
        
< TBODY >
        
< TR >
          
< TD  width =100  bgColor =#999999 >< FONT 
        
color =#ffffff >< B > a </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > a </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > a </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > a </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > a </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > a </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > a </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > a </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > a </ B ></ FONT ></ TD ></ TR >
        
< TR  vAlign =top  bgColor =#999999  height =100 >
          
< TD >< FONT  color =#ffffff >< B > d </ B ></ FONT ></ TD ></ TR ></ TBODY ></ TABLE ></ DIV ></ TD >
    
< TD  vAlign =top >
      
< DIV  id =scroll1  style ="OVERFLOW: auto; WIDTH: 300px; HEIGHT: 200px"  
      onscroll
=doscrollv(this); >
      
< TABLE  id =table3  cellSpacing =1  cellPadding =1  border =0 >
        
< TBODY >
        
< TR >
          
< TD  noWrap width =100  bgColor =#999999 >< FONT 
            
color =#ffffff >< B > 1asdf </ B ></ FONT ></ TD >
          
< TD  noWrap width =100  bgColor =#999999 >< FONT 
            
color =#ffffff >< B > 2asdf </ B ></ FONT ></ TD >
          
< TD  noWrap width =100  bgColor =#999999 >< FONT 
            
color =#ffffff >< B > 3asdf </ B ></ FONT ></ TD >
          
< TD  noWrap width =100  bgColor =#999999 >< FONT 
            
color =#ffffff >< B > 4asdf </ B ></ FONT ></ TD >
          
< TD  noWrap width =100  bgColor =#999999 >< FONT 
            
color =#ffffff >< B > 5asdf </ B ></ FONT ></ TD >
          
< TD  noWrap width =100  bgColor =#999999 >< FONT 
            
color =#ffffff >< B > 6asdf </ B ></ FONT ></ TD >
          
< TD  noWrap width =100  bgColor =#999999 >< FONT 
            
color =#ffffff >< B > 7asdf </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > asdf </ B ></ FONT ></ TD ></ TR >
        
< TR >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > 111111 </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > 111111 </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > 111111 </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > 111111 </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > 111111 </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT  color =#ffffff >< B > 111111 </ B ></ FONT ></ TD >
          
< TD  bgColor =#999999 >< FONT 
        
color =#ffffff >< B > 111111 </ B ></ FONT ></ TD ></ TR ></ TBODY ></ TABLE ></ DIV ></ TD ></ TR ></ TBODY ></ TABLE ></ BODY ></ HTML >

注意:需要设置列的宽度!

你可能感兴趣的:(类拟EXCEL表格锁定的功能的实现!)