代码如下:<!-- all files design & write by windy_sk, you can use it freely but ... you must keep this item ! email: seasonx@163.net --> <meta http-equiv="content-type" content="text/html; charset=gb2312"> <title>power table</title> <style> body{ font-size: 9pt; padding-right: 0px; padding-left: 0px; padding-bottom: 0px; padding-top: 0px; } input { font-size: 9pt; height: 15pt; width:50px; cursor: default; } table{ font-size: 9pt; word-break:break-all; cursor: default; border: black 1px solid; background-color:#eeeecc; border-collapse:collapse; border-color:#999999; align:center; } </style> <script language="javascript1.2"> /* this following code are designed and writen by windy_sk <seasonx@163.net> you can use it freely, but u must held all the copyright items! */ var main_tab = null; var cur_row = null; var cur_col = null; var cur_cell = null; var org_con = ""; var sort_col = null; var show_col = false; var charmode = true; var act_bgc = "#bec5de"; var act_fc = "black"; var cur_bgc = "#ccffcc"; var cur_fc = "black"; function init(){ cur_row = null; cur_col = null; cur_cell = null; sort_col = null; main_tab = powertable; read_def(main_tab) main_tab.onmouseover = overit; main_tab.onmouseout = outit; main_tab.onclick = clickit; main_tab.ondblclick = dblclickit; org_con = main_tab.outerhtml; arrowup = document.createelement("span"); arrowup.innerhtml = "5"; arrowup.style.csstext = "padding-right: 0px; margin-top: -3px; padding-left: 0px; font-size: 10px; margin-bottom: 2px; padding-bottom: 2px; overflow: hidden; width: 10px; color: blue; padding-top: 0px; font-family: webdings; height: 11px"; arrowdown = document.createelement("span"); arrowdown.innerhtml = "6"; arrowdown.style.csstext = "padding-right: 0px; margin-top: -3px; padding-left: 0px; font-size: 10px; margin-bottom: 2px; padding-bottom: 2px; overflow: hidden; width: 10px; color: blue; padding-top: 0px; font-family: webdings; height: 11px"; } function window.onload(){ init(); drag = document.createelement("div"); drag.innerhtml = ""; drag.style.textalign = "center"; drag.style.position = "absolute"; drag.style.cursor = "hand"; drag.style.border = "1 solid black"; drag.style.display = "none"; drag.style.zindex = "999"; document.body.insertbefore(drag); setinterval("judge_move()",100); setinterval("showcontent.value=main_tab.innerhtml;monitor.value='cur_row: '+cur_row+'; cur_col: '+cur_col + '; sort_col: ' +sort_col",1000); } function judge_move(){ move[0].disabled=(cur_row == null || cur_row<=1); move[1].disabled=(cur_row == null || cur_row==main_tab.rows.length-1 || cur_row == 0); move[2].disabled=(cur_col == null || cur_col==0); move[3].disabled=(cur_col == null || cur_col==main_tab.rows[0].cells.length-1); } document.onselectstart = function(){return false;} document.onmouseup = drag_end; function clear_color(){ the_table=main_tab; if(cur_col!=null){ for(i=0;i<the_table.rows.length;i++){ with(the_table.rows[i].cells[cur_col]){ style.backgroundcolor=obgc; style.color=ofc; } } } if(cur_row!=null){ for(i=0;i<the_table.rows[cur_row].cells.length;i++){ with(the_table.rows[cur_row].cells[i]){ style.backgroundcolor=obgc; style.color=ofc; } } } if(cur_cell!=null){ cur_cell.children[0].contenteditable = false; with(cur_cell.children[0].runtimestyle){ borderleft=bordertop=""; borderright=borderbottom=""; backgroundcolor=""; paddingleft=""; textalign=""; } } } function document.onclick(){ window.status = ""; clear_color(); cur_row = null; cur_col = null; cur_cell = null; } function read_def(the_table){ for(var i=0;i<the_table.rows.length;i++){ for(var j=0;j<the_table.rows[i].cells.length;j++){ with(the_table.rows[i]){ cells[j].obgc = cells[j].currentstyle.backgroundcolor; cells[j].ofc
本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)