Search code examples
jquerycsstablesortercss-tables

Adding styling to tablesorter


See this page, then click the "Table" tab.

I'm trying to add the triangles that indicate sorting, like this (http://datatables.net/blog/Twitter_Bootstrap_2), but I can't figure it out. The actual sorting is working, just not the styling.

How do I get this to work?


Solution

  • Your table headers w/ class .tablesorter-header are missing this CSS (change the url's of the images to your needs):

    table#national_universities_table thead tr .tablesorter-header {
        background-image: url("images/bg.gif");
        background-repeat: no-repeat;
        background-position: right center;
        cursor: pointer;
    }
    
    table#national_universities_table thead tr .tablesorter-headerAsc {
        background-image: url("images/asc.gif");
    }
    
    table#national_universities_table thead tr .tablesorter-headerDesc {
        background-image: url("images/desc.gif");
    }