<html> <head> <meta charset='utf-8'> <title> js表格分页</title> <script type="text/javascript" src="https://www.jb51.net/script.js"></script> <style type="text/css"> #idData {color: red;border: solid;text-align: center;} a{text-decoration: none;} </style> </head> <body> <table> <tr><td>测试编号1</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号2</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号3</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号4</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号5</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号6</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号7</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号8</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号9</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号10</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号11</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号12</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号13</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号14</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号15</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号16</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号17</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号18</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号19</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号20</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号21</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号22</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号23</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号24</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号25</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号26</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号27</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号28</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号29</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号30</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号31</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号32</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号33</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号34</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号35</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号36</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号37</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号38</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号39</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> <tr><td>测试编号40</td><td>25</td><td>单元格1</td><td>单元格2</td></tr> </table> <table> <tr><td><div></div></td></tr> </table> </body> </html> <script type="text/javascript" language="javascript"> window.onload = function(){ goPage(1,10); }; </script>
script.js: