怎么将html表格往下移,怎样把表格往下移??

2ec82c4fb238826df10cb206e4d031ff.png

2018-10-27

JS代码实现表格自动下移需要用到什么代码?

【实例代码】html xmlns=http://www。w3。org/1999/xhtml headtitle标题页-学无忧(www。xue51。com)/title/headbodydiv id=tblView style=border:#D3D3D3 1px solid;PADDING-LEFT: 1px;PADDING-top: 1px;width:339px;height:276px;overflow-x:hidden;overflow-y:scroll/DIV/bodyscript language=javascriptfunction bgChange(obj){ for (v...全部

【实例代码】html xmlns=http://www。w3。org/1999/xhtml headtitle标题页-学无忧(www。xue51。com)/title/headbodydiv id=tblView style=border:#D3D3D3 1px solid;PADDING-LEFT: 1px;PADDING-top: 1px;width:339px;height:276px;overflow-x:hidden;overflow-y:scroll/DIV/bodyscript language=javascriptfunction bgChange(obj){ for (var i=0; iobj。

parentElement。rows。length; i++) obj。parentElement。rows[i]。bgColor = obj。parentElement。rows[i] == obj ? '#EFE9E9' : 'white';//改变指定行的背景色 } htm=table width=100% border=0 align=center cellpadding=0 cellspacing=0 for(i=0;i5;i++){ //动态输出5行表格 o=i+1 htm+=tr id=td+o+ height=10 style='CURSOR: hand;' οnclick=bgChange(this); htm+= td style='font-size:12px;color:#6666f6;border-bottom:#D3D3D3 1px solid;border-right:#D3D3D3 1px solid' width=17 height=10 align='center'+o+/td htm+= td style='border-bottom:#D3D3D3 1px solid;border-right:#D3D3D3 1px solid' width=218nbsp;/td htm+= td style='border-bottom:#D3D3D3 1px solid' width=102nbsp;/td htm+=/tr }htm+=/TABLEtblView。

innerHTML=htm; //设置表格的内容b=0function setScroll(){ //调用表格滚动的方法 if (b==o){b=0} //第一行 b++; bgChange(document。

getElementById(td+b));//调用改变背景色的方法 setTimeout(setScroll(),2000); //每隔2秒调用一次}setScroll();/script/html。

收起

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值