SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru whisher's Avatar
    Join Date
    May 2006
    Location
    Kakiland
    Posts
    732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jQuery tablesorter alternate rows problem ...

    Hi.
    Server side I build a table with the usual
    two classes odd and even.
    When I put the tablesorter plug in according
    to the sort give to the data
    this classes don't follow the alternate
    order (odd even) with an ugly lay out
    Is there a way to work out the problem
    by the tablesorter script ?

    Bye.

  2. #2
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could add this into the script:

    Code Javascript:
    $('table tr:even').css({background:'white'});
    $('table tr:odd').css({background:'gray'})
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  3. #3
    SitePoint Guru whisher's Avatar
    Join Date
    May 2006
    Location
    Kakiland
    Posts
    732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by JimmyP View Post
    You could add this into the script:

    Code Javascript:
    $('table tr:even').css({background:'white'});
    $('table tr:odd').css({background:'gray'})
    Smart point
    but it's the same result
    all the classes mix-up

    PHP Code:
    $("#list-all").tablesorter({ 
             
    headers: {7:{sorterfalse}
            } 
        });
    $(
    'table tr:even').css({background:'white'});
    $(
    'table tr:odd').css({background:'gray'}); 

  4. #4
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it's available as a widget of the plugin. If you look here: http://tablesorter.com/docs/ - you'll see that the first example table has alternate class rows. If you look at the source where the $.tablesorter plugin is called, a widget is specified in one of the options as "zebra" - I'm assuming this is what initiates the gray/white alternating TRs.
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  5. #5
    SitePoint Guru whisher's Avatar
    Join Date
    May 2006
    Location
    Kakiland
    Posts
    732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by JimmyP View Post
    I think it's available as a widget of the plugin. If you look here: http://tablesorter.com/docs/ - you'll see that the first example table has alternate class rows. If you look at the source where the $.tablesorter plugin is called, a widget is specified in one of the options as "zebra" - I'm assuming this is what initiates the gray/white alternating TRs.

    At the same time
    Thanks for the help I worked out with:

    PHP Code:
    $("#list-all").tablesorter({ 
            
    widgets: ['zebra'],
             
    headers: {7:{sorterfalse}
            } 
        }); 
    and it keeps the same colour I put
    in the css file.
    Bye.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •