<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>텍스트 정렬:왼쪽; <BR>줄 높이:15px; <BR>높이:20px; <BR>} <BR>.bg td.tit{ <BR>배경색:#e2e2e2; <BR>높이:17px; <BR>텍스트 정렬:가운데; <BR>줄 높이:15px; <BR>} <BR>.bg td.num{ <BR>배경색:#e2e2e2; <BR>텍스트 정렬:오른쪽; <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>플로트:오른쪽; <BR>커서:e-크기 조정; <BR>} <BR>--></style> <br><script 언어="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*1 event.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*1 event.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='고정'; <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 :비; <BR>} <BR>} <BR>}<BR>// --></script> <br><본문> <br><table width="100%" class="bg" border=1cellspacing=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>订单客户name称</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>订单客户name称</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>订单客户name称</td> <br><td >시내부</td> <br><td >王老two</td> <br><td >银行卡</td> <br></tr> <br></테이블> <br><script 언어="javascript"><!-- <BR>//senfe("表格name称","奇数行背景","偶数行背景","鼠标经过背景","点击后背景"); <BR>theObjTable("theObj테이블","#c0c0c0","#fff","#a3a2a2"); <BR>// --></script> <br></body> <br></html> <br> </div>