<div class="codetitle"> <span><a style="CURSOR: pointer" data="84624" class="copybut" id="copybut84624" onclick="doCopy('code84624')"><u>コードをコピー</u></a></span> コードは次のとおりです:</div> <div class="codebody" id="code84624"> <br><html> <br><title>拖アニメ列宽の表</title> <br><meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <br><style type="text/css"><!-- <BR>.bg td{ <BR>font-size:12px; <BR>text-align:left; <BR>行の高さ:15px; <BR>高さ:20px; <BR>} <BR>.bg td.tit{ <BR>背景色:#e2e2e2; <BR>高さ:17px; <BR>text-align:center; <BR>行の高さ:15px; <BR>} <BR>.bg td.num{ <BR>背景色:#e2e2e2; <BR>text-align:right; <BR>行の高さ:15px; <BR>幅:30px; <BR>高さ:22px; <BR>} <BR>.resizeDivClass{ <BR>text-align:right; <BR>幅:1px; <BR>マージン:0px 0 0px 0; <BR>背景:#fff; <BR>ボーダー:0px; <BR>float:right; <BR>カーソル:e-resize; <BR>} <BR>--></style> <br><script language="javascript"><!-- <BR>function MouseDownToResize(obj){ <BR>setTableLayoutToFixed(); <BR>obj.mouseDownX=event.clientX; <BR>obj.pareneTdW=obj.parentElement.offsetWidth; <BR>obj.pareneTableW=theObjTable.offsetWidth; <BR>obj.setCapture(); <BR>} <BR>function MouseMoveToResize(obj){ <BR>if(!obj.mouseDownX) return false; <BR>var newWidth=obj.pareneTdW*1event.clientX*1-obj.mouseDownX; <BR>if(newWidth>10) <BR>{ <BR>var theObjTable = document.getElementById("theObjTable"); <BR>obj.parentElement.style.width = newWidth; <BR>theObjTable.style.width=obj.pareneTdW*1event.clientX*1-obj.mouseDownX; <BR>} <BR>} <BR>function MouseUpToResize(obj){ <BR>obj.releaseCapture(); <BR>obj.mouseDownX=0; <BR>} <BR>function setTableLayoutToFixed() <BR>{ <BR>var theObjTable = document.getElementById("theObjTable"); <BR>if(theObjTable.style.tableLayout=='fixed') return; <BR>var headerTr=theObjTable.rows[0]; <BR>for(var i=0;i<headerTr.cells.length;i ) <BR>{ <BR>headerTr.cells[i].styleOffsetWidth=headerTr.cells[i].offsetWidth; <BR>} <BR>for(var i=0;i<headerTr.cells.length;i ) <BR>{ <BR>headerTr.cells[i].style.width=headerTr.cells[i].styleOffsetWidth ; <BR>} <BR>theObjTable.style.tableLayout='fixed'; <BR>} <BR>function theObjTable(o,a,b,c){ <BR>var t=document.getElementById(o).getElementsByTagName("tr"); <BR>for(var i=0;i<t.length;i ){ <BR>t[i].style.backgroundColor=(t[i].sectionRowIndex%2==0)?a:b; <BR>t[i].onclick=function(){ <BR>if(this.x!="1"){ <BR>}else{ <BR>this.x="0"; <BR>this.style.backgroundColor=(this.sectionRowIndex%2==0)?a:b; <BR>} <BR>} <BR>t[i].onmouseover=function(){ <BR>if(this.x!="1")this.style.backgroundColor=c; <BR>} <BR>t[i].onmouseout=function(){ <BR>if(this.x!="1")this.style.backgroundColor=(this.sectionRowIndex%2==0)?a :b; <BR>} <BR>} <BR>}<BR>// --></script> <br><body> <br><table width="100%" class="bg" border=1 cellspacing=0 bordercolorlight="#7b7b7b" bordercolordark="#efefef" id="theObjTable"> <br><tr> <br><td class="num">序号</td> <br><td width="100px" class="tit"> <br><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span> <br>公司名称 <br></td> <br><td class="tit"> <br><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span> <br>订单客户 <br></td> <br><td class="tit"> <br><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span> <br>部门 <br></td> <br><td class="tit"> <br><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span> <br>业务员 <br></td> <br><td class="tit"> <br><span class="resizeDivClass" onMouseDown="MouseDownToResize(this);" onMouseMove="MouseMoveToResize(this);" onMouseUp="MouseUpToResize(this);"></span> <br>交款方式 <br></td> <br></tr> <br><tr> <br><td class="num" >1</td> <br><td >中国电信</td> <br><td >订单客户名称</td> <br><td >广告部</td> <br><td >王天一</td> <br><td >现金</td> <br></tr> <br><tr> <br><td class="num" >2</td> <br><td >中国移动</td> <br><td >订单客户名称</td> <br><td >营销部</td> <br><td >李小红</td> <br><td >信用卡</td> <br></tr> <br><tr> <br><td class="num" >3</td> <br><td >中国联通</td> <br><td >订单客户名称</td> <br><td >市场部</td> <br><td >王老二</td> <br><td >银行卡</td> <br></tr> <br></table> <br><script language="javascript"><!-- <BR>//senfe("表格名称","奇数行背景","偶数行背景","鼠标经过背景","点击后背景"); <BR>theObjTable("theObjTable","#c0c0c0","#fff","#a3a2a2"); <BR>// --></script> <br></body> <br></html> <br> </div>