Row Highligting...

Row Highligting...

brianmmbrianmm Posts: 41Questions: 0Answers: 0
edited May 2009 in General
I am trying to implement row highlighting according to http://datatables.net/examples/example_highlight.html

I cannot seem to blend it into my code, also I do not want column hightlight?



$(document).ready(function() {
$('#example').dataTable( {
"bPaginate": false,
"bSort": false,
"aoColumns": [
/* Name */ { "bSortable": false,
"bSearchable": true },
/* Writable */ { "bSortable": false,
"bSearchable": true },
/* Readable */ { "bSortable": false,
"bSearchable": true },
/* Type */ { "bSortable": false,
"bSearchable": true },
/* Size */ { "bSortable": false,
"bSearchable": true },
/* Action */ { "bSortable": false,
"bSearchable": false }
] } );
} );

Replies

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin
    Hi brianmm,

    Do you have:

    tr:hover { background-color: blue; } /* or whatever colour you want */

    in your css?

    Allan
  • brianmmbrianmm Posts: 41Questions: 0Answers: 0
    yes... I did try that, but weirdly it also applied it to the table headers too???
  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin
    Yup - your table header is a TR element as well. So the selector should apply to it!

    If you don't want this to happen you can try:

    tbody tr:hover { ... }
  • brianmmbrianmm Posts: 41Questions: 0Answers: 0
    Cheers, works for me :)

    Should have known that been doign CSS long enough! Been a busy week!
This discussion has been closed.