user1895259
user1895259

Reputation: 147

Problems with jPages (jQuery Plugin)

I have some problems with jPages. I have a table and want to use the pagination which jPages provides. When I saw the row by row fadeTo effect from the example on the given page, I decided to have the same on my table. By doing so I faced these problems:

I solved this problem by using border-separate and using border-spacing 0px instead and append the row style to the cell elements instead of the row elements and by changing the rowstyles in that way that they only have borders at the top instead of top and bottom.

By using divs instead of table tags none of the problems exists! But I know that it ist semantically incorrect.

So my questions are: How to solve the last problems? And why do these problems exist by using table tags? And maybe anyone knows why my solutions work, because I can't find an explanation for what I investigated.

Here's the current code:

<script>
    $(document).ready(function() {
        $(function(){
            $("div.holder").jPages({
                containerID : "torsch",
                perPage: 40
            });
        });
    }); 
</script>

CSS:

<style>
    .rowstyle2 {    
        height:25px;
        border-left: 0px none;
        border-right:0px none;
        border-top: 1px solid #999;
        border-bottom: 1px solid #999;
        background: url("/images/test.png") repeat-x scroll 0% 0% transparent;
        vertical-align:middle;
    }

    .rowstyle1 {
        background-color:#FFFFFF;
        height:25px;
        border-top: 0px none;
        border-bottom: 0px none;
        border-left:0px none;
        border-right:0px none;  
        vertical-align:middle;
    }

    table {
        border-spacing: 0px;    
    }
</style>

HTML:

<div class="holder"></div>
<table>
    <thead>
        <th>col1</th>
        <th>col2</th>
        <th>col3</th>
    </thead>
    <tbody id="torsch">
        <tr>
            <td class="rowstyle2">1</td>
            <td class="rowstyle2">45</td>
            <td class="rowstyle2">4546</td>
        </tr>
        <tr>
            <td class="rowstyle1">1</td>
            <td class="rowstyle1">45</td>
            <td class="rowstyle1">4546</td>
        </tr>
        <tr>
            <td class="rowstyle2">1</td>
            <td class="rowstyle2">45</td>
            <td class="rowstyle2">4546</td>
        </tr>
        <tr>
            <td class="rowstyle1">1</td>
            <td class="rowstyle1">45</td>
            <td class="rowstyle1">4546</td>
        </tr>
        <tr>
            <td class="rowstyle2">1</td>
            <td class="rowstyle2">45</td>
            <td class="rowstyle2">4546</td>
        </tr>
    </tbody>
</table>

Upvotes: 0

Views: 1462

Answers (1)

Eduardo Paz
Eduardo Paz

Reputation: 164

Check, if anyone having same problem Please change in JPage.js line 58

/* only visible items! */
// this._items = this._container.children(":visible");
this._items = this._container.children();

It worked for me.

Upvotes: 0

Related Questions