100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > 拖动table标题实现改变td的大小(css+js代码)【javascript】

拖动table标题实现改变td的大小(css+js代码)【javascript】

时间:2021-03-31 18:20:00

相关推荐

拖动table标题实现改变td的大小(css+js代码)【javascript】

web前端|js教程

拖动,标题,td

web前端-js教程

子站源码,电脑安装ubuntu卡,爬虫软件下载视频,php破解方法,dedecms设置seolzw

拖动列宽的表格

元素p2p源码,vscode让文字滚动起来,ubuntu凤凰系统,tomcat自动生成内存堆栈,go异步爬虫,php用户管理后台,沙井seo优化服务商lzw

<!--

.bg td{

font-size:12px;

text-align:left;

line-height:15px;

height:20px;

}

.bg td.tit{

background-color:#e2e2e2;

height:17px;

text-align:center;

line-height:15px;

}

.bg td.num{

background-color:#e2e2e2;

text-align:right;

line-height:15px;

width:30px;

height:22px;

}

.resizeDivClass{

text-align:right;

width:1px;

margin:0px 0 0px 0;

background:#fff;

border:0px;

float:right;

cursor:e-resize;

}

-->

<!--

function MouseDownToResize(obj){

setTableLayoutToFixed();

obj.mouseDownX=event.clientX;

obj.pareneTdW=obj.parentElement.offsetWidth;

obj.pareneTableW=theObjTable.offsetWidth;

obj.setCapture();

}

function MouseMoveToResize(obj){

if(!obj.mouseDownX) return false;

var newWidth=obj.pareneTdW*1+event.clientX*1-obj.mouseDownX;

if(newWidth>10)

{

var theObjTable = document.getElementById("theObjTable");

obj.parentElement.style.width = newWidth;

theObjTable.style.width=obj.pareneTdW*1+event.clientX*1-obj.mouseDownX;

}

}

function MouseUpToResize(obj){

obj.releaseCapture();

obj.mouseDownX=0;

}

function setTableLayoutToFixed()

{

var theObjTable = document.getElementById("theObjTable");

if(theObjTable.style.tableLayout==fixed) return;

var headerTr=theObjTable.rows[0];

for(var i=0;i<headerTr.cells.length;i++)

{

headerTr.cells[i].styleOffsetWidth=headerTr.cells[i].offsetWidth;

}

for(var i=0;i<headerTr.cells.length;i++)

{

headerTr.cells[i].style.width=headerTr.cells[i].styleOffsetWidth;

}

theObjTable.style.tableLayout=fixed;

}

function theObjTable(o,a,b,c){

var t=document.getElementById(o).getElementsByTagName("tr");

for(var i=0;i<t.length;i++){

t[i].style.backgroundColor=(t[i].sectionRowIndex%2==0)?a:b;

t[i].onclick=function(){

if(this.x!="1"){

}else{

this.x="0";

this.style.backgroundColor=(this.sectionRowIndex%2==0)?a:b;

}

}

t[i].onmouseover=function(){

if(this.x!="1")this.style.backgroundColor=c;

}

t[i].onmouseout=function(){

if(this.x!="1")this.style.backgroundColor=(this.sectionRowIndex%2==0)?a:b;

}

}

}

// -->

微信群大全 源码,vscode苹果商店没有,ubuntu无法修复,jar包tomcat版本,爬虫套件,php 二进制转十六进制,移动如何做seo,老y网站管理,织梦内核文章模板lzw

<!--

//senfe("表格名称","奇数行背景","偶数行背景","鼠标经过背景","点击后背景");

theObjTable("theObjTable","#c0c0c0","#fff","#a3a2a2");

// -->

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。