HTML表格中的分页 [英] Pagination in HTML table

查看:871
本文介绍了HTML表格中的分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





i尝试为此html表创建寻呼机我尝试下面的代码



< b>我尝试了什么:



 <   div     id   =  pageNavPosition >  <   / div  >  

< span class =code-keyword>< script type = text / javascript > <! -
var pager = new 寻呼机(' tabledata' 10 );
pager.init();
pager.showPageNav(' pager' ' pageNavPosition');
pager.showPage( 1 );
// - >< / script





根据此链接



http://en.newinstance.it/2006/09/27 / client-side-html-table-pagination-with-javascript /



但是当我试试这个时没有寻呼机

解决方案

试试这样



 <  !doctype     html  >  
< html lang = en >
< head >
< script src = paging.js > < / 脚本 >
< script src = http://code.jquery.com/jquery-1.10.2.js > < / script >
< <跨度class =code-leadattribute> style type = text / css >
pg-normal {
color < span class =code-keyword> black;
font-weight 正常;
text-decoration 无;
cursor 指针;
}

pg-selected {
颜色 black;
font -weight 粗体;
text-decoration 下划线;
游标 指针;
}
< / style >

< script >

var pager; // 声明寻呼机变量


function (){
var final = [[ 1 ' a'' a1'],[ 2 ' b'' b'],[ 3 ' c'' c3'],[ 4 ' d'' 4d' ],[ 5 ' e'' 5e']
,[ 6 ' f'' 6f'],[ 7 ' g'' 7g' ]]


#tabledata)。append(

hi

i try to create pager for html table for this i try below code

What I have tried:

<div id="pageNavPosition"></div>

<script type="text/javascript"><!--
var pager = new Pager('tabledata', 10);
pager.init();
pager.showPageNav('pager', 'pageNavPosition');
pager.showPage(1);
//--></script



according to this link

http://en.newinstance.it/2006/09/27/client-side-html-table-pagination-with-javascript/

but when i try this there is no pager

解决方案

try like this

<!doctype html>
<html lang="en">
<head>
    <script src="paging.js"></script>
    <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
    <style type="text/css">
        .pg-normal {
            color: black;
            font-weight: normal;
            text-decoration: none;
            cursor: pointer;
        }

        .pg-selected {
            color: black;
            font-weight: bold;
            text-decoration: underline;
            cursor: pointer;
        }
    </style> 

    <script>

        var pager; // declare the pager variable outside


(function () { var final = [[1, 'a', 'a1'], [2, 'b', 'b'], [3, 'c', 'c3'], [4, 'd', '4d'], [5, 'e', '5e'] , [6, 'f', '6f'], [7, 'g', '7g']]


("#tabledata").append(


这篇关于HTML表格中的分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆