Odd & Even Row Colors are not consistent

Odd & Even Row Colors are not consistent

jaredgerberjaredgerber Posts: 40Questions: 10Answers: 0

I've noticed that on some of my Datatables reports, the alternating row colors are not always consistent. e.g., sometimes there are 2 or 3 rows of the same color.

Is this a common issue or there a simple answer for this issue?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,814Questions: 1Answers: 10,123 Site admin

    That shouldn't happen. Can you link to the page showing the issue please?

    Thanks,
    Allan

  • jaredgerberjaredgerber Posts: 40Questions: 10Answers: 0

    Here is the link:
    http://174.120.222.66/~opes/agent/rpt_points_recruits.php

    Here is the code:

    $(document).ready(function()
    {
            var userid = $("#userid").val();
            var scope = $("#scope").val();
            var teamtotals = $("#teamtotals").val();
            var license = $("#license").val();
            var contractid = $("#contractid").val();
            var fromdate = $("#fromdate").val();
            var todate = $("#todate").val();
            var agentinfo = $("#agentinfo").val();
            var sort = $("#sort").val();
    
        /* Init DataTables */
        $("#pleasewait").show();
    
        table = $('#prc').dataTable( {
            "dom": '<"top"fl<"clear">>rt<"bottom"<"clear">>',
            "bProcessing": true,
            "bServerSide": true,
            "paging": true,
            "pageLength": 10,
            "lengthMenu": [10, 25, 50],
            "info": false,
            "ordering": false,
            "fnRowCallback" : function(nRow, aData, iDisplayIndex){
                    $("td:first", nRow).html(iDisplayIndex +1);
                   return nRow;
                },
            "sAjaxSource": 'php/processList.php?list=prcX&contractid='+contractid+'&fromdate='+fromdate+'&todate='+todate+'&sort='+sort+'&userid='+userid+'&scope='+scope+'&teamtotals='+teamtotals
        } );
    
  • allanallan Posts: 61,814Questions: 1Answers: 10,123 Site admin
    Answer ✓

    Your CSS contains:

    .gridContainer tbody tr:nth-child(5n+1) {
       background: #fafafa;
    }
    

    (line 59 in gc.css) which would probably explain it.

    Allan

This discussion has been closed.