title: Control row stripe color in datatable output
body: <p>What is the "best" way is to set a custom row stripe/row striping color in datatable (DT)?</p>
  
  <p>I'm using datatable (DT) to create interactive tables (e.g HTML via rmarkdown), with download ability, etc. That's why I'm not using Huxtable or any other table formatting package, and ideally I don't have to style the table first in another package before sending it to datatable - though open to this if necessary/best available option.</p>
  
  <p>Here is a self-contained example of row striping, modified from the example shown here, answer#1  (<a href="https://src-bin.com/en/q/1b3261f" rel="noreferrer">https://src-bin.com/en/q/1b3261f</a>), similar to this <a href="https://stackoverflow.com/questions/42708508/dtdatatable-customization-stripes">unsuccessful attempt</a>. One issue is that the hover color no longer works, though it is meant to be a tint applied to whatever is there? Another is that the row color stays with the original row data after re-ordering by column - not sure if this default behavior is what I want - is it easy to change?</p>
  
  <pre><code>  DT::datatable(head(iris, 20),
                  extensions = 'Buttons',
                  options=list(dom = 'Bfrtip',
                               buttons = c('excel','csv','print'),
                               rowCallback=JS(
                                 'function(row,data) {
       if($(row)["0"]["_DT_RowIndex"] % 2 &lt;1) 
              $(row).css("background","#f2f9ec")
     }'))) 
  </code></pre>
  
  <p>There's an option here to color background of cells by value, which is not what I'm after:
  <a href="https://community.rstudio.com/t/color-cells-in-dt-datatable-in-shiny/2288/2?u=mbn" rel="noreferrer">color-cells-in-dt-datatable-in-shiny</a></p>
  
  <p>Datatables(dot)net <a href="https://datatables.net/manual/styling/theme-creator" rel="noreferrer">datatables.net/manual/styling/theme-creator</a> has an example stylesheet that creates a whole pile of CSS (357 lines of code), which presumably could be used in a style.css file to do what is required (row striping, custom color)? That seems overkill to me when I think the secret sauce for my purpose is just this line of code (below). Note, the default behavior of the datatable example has striping independent of the initial row number (c.f code above where striping stays with the original raw data). Can I get the code below into the r datatable code directly, e.g. like the example above?</p>
  
  <pre><code>table.dataTable.stripe tbody tr.odd, table.dataTable.display tbody tr.odd {`
  background-color` `: ` `#f9f9f9` `; }`
  </code></pre>