📄 功能强大的表格排序.htm
字号:
var newrow=the_table.insertRow(the_row); for (var i=0;i<the_table.rows[0].cells.length;i++) { the_cell=newrow.insertCell(i); the_cell.innerText="NewRow_" + the_cell.parentElement.rowIndex; } read_def(the_table);}function del_row(the_table) { if(the_table.rows.length==1) return; var the_row; the_row = (cur_row==null || cur_row==0)?-1:cur_row; the_table.deleteRow(the_row); cur_row = null; cur_cell=null;}function add_col(the_table) { event.cancelBubble=true; var the_col,i,the_cell; the_col = cur_col==null?-1:(cur_col+1); var the_title=prompt("Please input the title: ","Untitled"); if(the_title==null)return; if(the_col!=-1 && the_col<=sort_col && sort_col!=null)sort_col++; the_title=the_title==""?"Untitled":the_title clear_color(); for(var i=0;i<the_table.rows.length;i++){ the_cell=the_table.rows[i].insertCell(the_col); the_cell.innerText=i==0?the_title:("NewCol_" + the_cell.cellIndex); } read_def(the_table);}function del_col(the_table) { if(the_table.rows[0].cells.length==1) return; var the_col,the_cell; the_col = cur_col==null?(the_table.rows[0].cells.length-1):cur_col; if(the_col!=-1 && the_col<sort_col && sort_col!=null)sort_col--; else if(the_col==sort_col)sort_col=null; for(var i=0;i<the_table.rows.length;i++) the_table.rows[i].deleteCell(the_col); cur_col = null; cur_cell=null;}function res_tab(the_table){ the_table.outerHTML=Org_con; init();}function exp_tab(the_table){ var the_content=""; document.onclick(); the_content=the_table.outerHTML; the_content=the_content.replace(/ style=\"[^\"]*\"/g,""); the_content=the_content.replace(/ mode=\"(false|true)"/g,""); the_content=the_content.replace(/ oBgc=\"[\w#\d]*\"/g,""); the_content=the_content.replace(/ oFc=\"[\w#\d]*\"/g,""); the_content=the_content.replace(/<DIV contentEditable=false>([^<]*)<\/DIV>/ig,"$1"); the_content="<style>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>\n"+the_content; var newwin=window.open("about:blank","_blank",""); newwin.document.open(); newwin.document.write(the_content); newwin.document.close(); newwin=null;}</SCRIPT>
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<TABLE id=PowerTable cellSpacing=0 cellPadding=2 width="100%" border=1>
<TBODY>
<TR align=middle bgColor=#ffcc00>
<TD>First Name</TD>
<TD>Last Name</TD>
<TD>Team</TD>
<TD>Engine</TD>
<TD>Tyres</TD>
<TD>Fastest Lap</TD>
<TD>国家</TD></TR>
<TR>
<TD>Michael</TD>
<TD>Schumacher</TD>
<TD>Ferrari</TD>
<TD>Ferrari</TD>
<TD>Bridgestone</TD>
<TD>1.15.872</TD>
<TD>德国</TD></TR>
<TR>
<TD>Rubens</TD>
<TD>Barrichello</TD>
<TD>Ferrari</TD>
<TD>Ferrari</TD>
<TD>Bridgestone</TD>
<TD>1.16.760</TD>
<TD>法国</TD></TR>
<TR>
<TD>Ralph</TD>
<TD>Schumacher</TD>
<TD>Williams</TD>
<TD>BMW</TD>
<TD>Michelin</TD>
<TD>1.16.297</TD>
<TD>美国</TD></TR>
<TR>
<TD>Juan-Pablo</TD>
<TD>Montoya</TD>
<TD>Williams</TD>
<TD>BMW</TD>
<TD>Michelin</TD>
<TD>1.17.123</TD>
<TD>柬埔寨</TD></TR>
<TR>
<TD>David</TD>
<TD>Coulthard</TD>
<TD>McLaren</TD>
<TD>Mercedes</TD>
<TD>Bridgestone</TD>
<TD>1.16.423</TD>
<TD>泰国</TD></TR>
<TR>
<TD>Mika</TD>
<TD>Hakkinen</TD>
<TD>McLaren</TD>
<TD>Mercedes</TD>
<TD>Bridgestone</TD>
<TD>1.16.979</TD>
<TD>越南</TD></TR>
<TR>
<TD>Jarno</TD>
<TD>Trulli</TD>
<TD>Jordan</TD>
<TD>Honda</TD>
<TD>Bridgestone</TD>
<TD>1.16.459</TD>
<TD>菲律宾</TD></TR>
<TR>
<TD>Ricardo</TD>
<TD>Zonta</TD>
<TD>Jordan</TD>
<TD>Honda</TD>
<TD>Bridgestone</TD>
<TD>1.17.328</TD>
<TD>英国</TD></TR>
<TR>
<TD>Olivia</TD>
<TD>Panis</TD>
<TD>BAR</TD>
<TD>Honda</TD>
<TD>Bridgestone</TD>
<TD>1.16.771</TD>
<TD>蒙古</TD></TR>
<TR>
<TD>Jacques</TD>
<TD>Villeneuve</TD>
<TD>BAR</TD>
<TD>Honda</TD>
<TD>Bridgestone</TD>
<TD>1.17.035</TD>
<TD>马来西亚</TD></TR>
<TR>
<TD>Kimi</TD>
<TD>Raikkonen</TD>
<TD>Sauber</TD>
<TD>Petronas</TD>
<TD>Bridgestone</TD>
<TD>1.16.875</TD>
<TD>缅甸</TD></TR>
<TR>
<TD>Nick</TD>
<TD>Heidfeld</TD>
<TD>Sauber</TD>
<TD>Petronas</TD>
<TD>Bridgestone</TD>
<TD>1.17.165</TD>
<TD>朝鲜</TD></TR>
<TR>
<TD>Eddie</TD>
<TD>Irvine</TD>
<TD>Jaguar</TD>
<TD>Cosworth</TD>
<TD>Michelin</TD>
<TD>1.18.016</TD>
<TD>中国</TD></TR>
<TR>
<TD>Pedro</TD>
<TD>de la Rosa</TD>
<TD>Jaguar</TD>
<TD>Cosworth</TD>
<TD>Michelin</TD>
<TD>1.18.015</TD>
<TD>俄罗斯</TD></TR>
<TR>
<TD>Hugh</TD>
<TD>Gengine</TD>
<TD>Lotus</TD>
<TD>Renault</TD>
<TD>Michelin</TD>
<TD>1.15.015</TD>
<TD>韩国</TD></TR>
<TR>
<TD>Gloria</TD>
<TD>Slap</TD>
<TD>Lotus</TD>
<TD>Renault</TD>
<TD>Michelin</TD>
<TD>1.15.012</TD>
<TD>日本</TD></TR></TBODY></TABLE>
<P><INPUT onclick=add_row(Main_Tab) type=button value=ins_row> <INPUT onclick=add_col(Main_Tab) type=button value=ins_col> <INPUT onclick=del_row(Main_Tab) type=button value=Del_row> <INPUT onclick=del_col(Main_Tab) type=button value=Del_col> <INPUT onclick=res_tab(Main_Tab) type=button value=Restore> <INPUT onclick=exp_tab(Main_Tab) type=button value=Export> ( Move: <INPUT id=move onclick=Move_up(Main_Tab) type=button value=Up> <INPUT id=move onclick=Move_down(Main_Tab) type=button value=Down> <INPUT id=move onclick=Move_left(Main_Tab) type=button value=Left> <INPUT id=move onclick=Move_right(Main_Tab) type=button value=Right> ) <SPAN
style="CURSOR: hand; COLOR: red; TEXT-DECORATION: underline"
onclick="if(detail.style.display==''){detail.style.display='none';this.innerText='Show Detail'}else{detail.style.display='';this.innerText='Hide Detail'}">Show
Detail</SPAN> </P>
<DIV id=detail style="DISPLAY: none"><INPUT id=monitor style="WIDTH: 200px"
size=30> <BR><TEXTAREA id=showContent rows=20 cols=100></TEXTAREA> </DIV>
<P align=right><A href="http://fason.nease.net/">【阿信的小天地】</A></P></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -