title: Synchronize horizontal scrollbars for DataTables in R Shiny application
body: <p>Is there a way to get the horizontal scrollbars from a DataTable to be synchronized or even just have one horizontal scrollbar for multiple tables? I'm trying to have it where multiple tables with the same number of columns and column widths would be lined up together when the user uses the horizontal scrollbar.</p>
  <p>So for example, in the sample code below, I'm trying to get each of the columns labeled &quot;V#&quot; to line up between the two tables as a user uses one of the horizontal scrollbars.</p>
  <pre><code>library(shiny)
  library(DT)
  library(dplyr)
  
  
  ui &lt;- fluidPage(
   
      fluidRow(
          DT::dataTableOutput(&quot;setosa_table&quot;)
      ),
      
      fluidRow(
          DT::dataTableOutput(&quot;virginica_table&quot;)
      )
      
      
  )
  
  server &lt;- function(input, output) {
      
      # Data
      data &lt;- iris %&gt;%
          mutate(Species = as.factor(Species))
  
      setosa_data &lt;- t(data.frame(data %&gt;%
                                      filter(iris$Species == 'setosa'))
      )
      
      virginica_data &lt;- t(data.frame(data %&gt;%
                                      filter(iris$Species == 'virginica'))
      )
      
      # Data Table Outputs
      output$setosa_table &lt;- renderDataTable({
          datatable(setosa_data,
                    extensions = 'FixedColumns',
                    options = list(scrollX = TRUE,
                                   fixedColumns = list(leftColumns = 1, rightColumns = 0))
          )
      })
      
      output$virginica_table &lt;- renderDataTable({
          
          datatable(virginica_data,
                    extensions = 'FixedColumns',
          options = list(scrollX = TRUE,
                         fixedColumns = list(leftColumns = 1, rightColumns = 0))
          )
      })
      
  }
  
  # Run the application 
  shinyApp(ui = ui, server = server)
  
  </code></pre>