title: How to right align columns of DataTable in R Shiny?
body: <p>From <a href="https://stackoverflow.com/questions/12527707/giving-right-align-to-numeric-data-in-datatables">this post</a> I gather we should define an <code>alignRight</code> CSS class with the desired alignment:</p>
  
  <pre><code># ui.R
  sidebarLayout(...,
      mainPanel(
          tags$head(
              tags$style(".alignRight { align: right; }", media = "all", type = "text/css")
          ),
          ...     # content with call to dataTableOutput("myTable")
      )
  )
  </code></pre>
  
  <p>and then when creating the DataTable, use the <a href="http://datatables.net/usage/columns" rel="nofollow noreferrer"><code>aoColumnDefs</code></a> option to set class of the desired columns to <code>alignRight</code>:</p>
  
  <pre><code># server.R
  shinyServer(
      function(input, output) {...
          output$myTable &lt;- renderDataTable(...,
              options = list(
                  aoColumnDefs = '[{"aTargets": [7, 9, 10], "sClass": "alignRight"}]'
              )
          )
      }
  )
  </code></pre>
  
  <p>However, this has had no effect on my DataTable, when remains left aligned for all columns. I thought a simple alignment issue would be easy to sort out, but after many hours, apparently not so. Any ideas would be much appreciated.</p>