/** * Created by ttang on 2016/5/24. */ $(document).ready(function(){ $("th").each(function(){ $(this).css("width",$(this).width()-1); }); resizeable_table = function(colS,colE,p1,p2){ var headerTds = document.getElementById("homework_table").rows[0].cells; var mousedown = false; var resizeable = false; var targetTd; var screenXStart =0; var tdWidth = 0; var headerWidth = 0; var tblObj = document.getElementById("homework_table"); var tblWidth = tblObj.offsetWidth; for(var i = colS;i totalWidth || tdWidth2 > totalWidth){ tartgetTd = null; resizeable = false; mousedown = false; }else{ targetTd.style.width = width; targetTd.nextElementSibling.style.width = width2; } }else{ var trObj = tblObj.rows[0]; if(srcObj.offsetWidth - offsetX <=5){//实际改变本单元格列宽 targetTd=srcObj; resizeable = true; for(var i = colS;i