How to have buttons and a "Show Entries" using Datatables (DT) in Rmarkdown?

Viewed 760

I'm trying to make a table that has both shows entries and buttons so my peers can export the data from the table.

At first when I added the tables it covered the "Show Entries" section that is usually on the top left. So I wrote this CSS code which moved the buttons to the center of the table but my "Show Entries" section is still empty.

Here is my Rmarkdown code


output: html_document

```{r}  

library(readr)
library(DT)

mtcars <- mtcars


    
  
```{css echo=FALSE}

.dataTables_wrapper .dt-buttons {
  float:none;  
  text-align:center;
}
datatable(mtcars,
          extensions = 'Buttons', options = list(
            dom = 'Bfrtip',
            buttons = c('copy','excel', 'pdf')
          )
) 

This is what loads for me enter image description here

How can I add the "Show Entries" feature?

enter image description here

1 Answers

Use dom = 'Blfrtip' instead of dom = 'Bfrtip'

Related