Português
<!-- 把下面代码加到<corpo>区域中 --> <estilo> TD{borda: 1 sólido #000000} .dark{} .light{cor de fundo: #000000; cor: #FFFFFF} </style> <script> var now_tr = 0; var can_scroll = falso; função document.onkeydown() { if(!can_scroll) return; if(event.keyCode==38) { if(now_tr!=0) { document.body.style.overflowY = "oculto" document.getElementById("the_table").rows(now_tr).className="dark"; agora_tr--; document.getElementById("the_table").rows(now_tr).className="light"; } else { document.body.style.overflowY = ""; can_scroll = falso; } } if(event.keyCode==40) { if(now_tr!=(document.getElementById("the_table").rows.length-1)) { document.body.style.overflowY = "oculto" document.getElementById( "a_tabela").rows(now_tr).className="dark"; agora_tr++; document.getElementById("the_table").rows(now_tr).className="light"; } else { document.body.style.overflowY = ""; can_scroll = falso; } } document.getElementById("the_table").rows(now_tr).scrollIntoView(true) } function return_now_tr() { document.body.style.overflowY = "oculto" can_scroll = true; if(event.srcElement.tagName=="TD") { document.getElementById("the_table").rows(now_tr).className="dark"; agora_tr = event.srcElement.parentElement.sectionRowIndex; document.getElementById("the_table").rows(now_tr).className="light"; } } </script> <form method="POST" action="javascript:alert('当前提交的是第'+now_tr+'行');" onkeydown="if(event.keyCode==13)this.submit()"> <table id="the_table" border="0" width="100%" onclick="return_now_tr()" ondblclick="this.parentElement .submit();"> <tr class="light"> <td>0</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>1</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>2</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>3</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>4</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>5</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>6</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>7</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr > <td>0</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>1</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>2</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>3</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>4</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>5</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>6</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>7</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr > <td>0</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>1</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>2</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>3</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>4</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>5</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>6</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>7</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr > <td>0</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>1</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>2</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>3</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>4</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>5</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>6</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>7</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr > <td>0</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>1</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>2</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>3</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>4</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>5</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>6</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> <tr> <td>7</td> <td> </td> <td> </td> <td> </td> <td> </td > <td> </td> </tr> </table> </form>