JS基于封装函数实现的表格分页完整示例

<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:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/15e98d067cce76c2407adfaf869fa60d.html