css control on a particular row

css control on a particular row

sdagastinosdagastino Posts: 1Questions: 0Answers: 0
edited August 2011 in DataTables 1.8
I am building a jquery table that has about 10 rows (for example). I am rendering this information using JSONArray from java. I want to add a border on the bottom of every 3rd row (for example). How do I dynamically do that? Is this something that can be added to the java side rendering by adding something to JSON?

Replies

  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    DataTables allows you to specify a set of repeating CSS classes to apply to your rows. by default, "even" and "odd" stripes will be used, but you can override this and add your own list

    asStripClasses property. see http://www.datatables.net/ref

    if you want to use both the even/odd AND underline every 3rd row, make an array of 6 css class-list values, where "even", "odd", and "underline" are classes you define in your css file:
    [code]
    $(document).ready( function() {
    $('#example').dataTable( {
    "asStripClasses": [ 'odd', 'even', 'odd underline', 'even', 'odd', 'even underline' ]
    } );
    } )
    [/code]
This discussion has been closed.