table sorter images not applying in tablesorter.js?

后端 未结 2 1784
走了就别回头了
走了就别回头了 2021-01-23 14:38

I am trying to apply the sorter images to table sorter table like the below.But the styles are not applying. using the below js file

https://github.com/Mottie/ta         


        
相关标签:
2条回答
  • 2021-01-23 14:43

    The latest version of tablesorter uses different class names from the original. Try using the following css:

    .tablesorter thead tr .header {
        background-image: url('/Public/images/sorter/bg.gif');  
        background-repeat: no-repeat;
        background-position: center right;
        cursor: pointer;
    }
    .tablesorter thead tr .headerSortAsc {
        background-image: url('/Public/images/sorter/asc.gif'); 
    }
    .tablesorter thead tr .headerSortDesc {
        background-image: url('/Public/images/sorter/desc.gif'); 
    }
    

    If you want to change the actual class name, then modify the cssAsc and cssDesc option.

    0 讨论(0)
  • 2021-01-23 14:55

    Try to wrap your jQuery code inside DOM ready handler:

    $(function() {
        $('#requestheader').tablesorter({
           /* theme: 'blue',*/
            sortList: [
                [1, 0]
            ],
            widgets: ['zebra', 'columns']
        });
    });
    
    0 讨论(0)
提交回复
热议问题