Questions tagged [dt]

DT is an R package that provides an interface to the JavaScript library DataTables. Use the data.table tag for questions related to the data.frame extension package data.table.

The R package DT provides an R interface to the JavaScript library DataTables. R data objects (matrices or data frames) can be displayed as tables on HTML pages, and DataTables provides filtering, pagination, sorting, and many other features in the tables. See the package website http://rstudio.github.io/DT for more information.

1888 questions
169
votes
15 answers

DataTable: Hide the Show Entries dropdown but keep the Search box

Is it possible to hide the Show Entries dropdown but keep the Search box in DataTable? I want to always display 10 rows with pagination at the bottom along with search box but do not want to display the Show entries dropdown.
FaisalKhan
  • 2,406
  • 3
  • 25
  • 32
67
votes
1 answer

Column alignment in DT datatable

In my shiny app I am using datatable function from DT library to construct a table and want to align columns on center. I can use formatStyle('column', textAlign = 'center') but it affects only column body and not the header.
danas.zuokas
  • 4,551
  • 4
  • 29
  • 39
62
votes
1 answer

How do I suppress row names when using DT::renderDataTable in R shiny?

As per the explanation in section 2.3 here, I can remove rownames for a datatable by setting rownames = FALSE How do I suppress row names when using DT::renderDataTable in R shiny? The following doesn't work because if you look at the dataTables…
Frikster
  • 2,755
  • 5
  • 37
  • 71
55
votes
2 answers

R Shiny set DataTable column width

I am trying to set the width of columns in a DataTable rendered in Shiny and am not able to implement it using the aoColumnDefs options. Has anyone tried this before ? My table has 1 text followed by 3 numeric columns. The numeric columns need to be…
xbsd
  • 2,438
  • 4
  • 25
  • 35
52
votes
5 answers

Remove 'search' option but leave 'search columns' option

I would like to remove 'global search' option from my application, but leave 'column search' option. Any ideas? I've tried different paramethers like searching=FALSE, filtering='none'... None of this works properly. My…
Marta
  • 3,032
  • 3
  • 17
  • 34
29
votes
1 answer

Convert a column of text URLs into active hyperlinks in Shiny

I am creating a user interface for a pathway enrichment program. The results are shown in a table as shown below. Below is a snippet showing that I am using DT::renderDataTable and DT::datatable to output the table in a tab. spia_out() is just a…
Komal Rathi
  • 4,164
  • 13
  • 60
  • 98
26
votes
1 answer

How to hide a column using the DT package - columnDefs parameter doesn't work

I would like to hide a column (col4 in example below) in a dataframe using the DT package. I've incorporated the code snippet found here, to no avail - col4 still shows. Here is my sessionInfo, along with my reproducible example. >…
matsuo_basho
  • 2,833
  • 8
  • 26
  • 47
26
votes
2 answers

Hide certain columns in a responsive data table using DT package

I am trying to create a responsive data table for my shiny application using DT package. I want to hide certain columns in advance. For example: library("shiny") library("DT") shinyApp( ui = fluidPage(DT::dataTableOutput('tbl')), server =…
skorkmaz
  • 566
  • 1
  • 6
  • 12
25
votes
3 answers

Add download buttons in DT::renderDataTable

I am trying to add download buttons ('copy', 'csv', 'excel', 'pdf') above the table in my R Shiny app, but the renderDataTable seems doesn't work when using a datatable inside. output$mytable1 <- DT::renderDataTable( datatable( …
Remi
  • 961
  • 1
  • 13
  • 25
23
votes
4 answers

changing font size in R DataTables (DT)

Have been trying to change the font size of all text in the tables generated by DT. However, I could only figure out how to change the size of the records using formatStyle(names(datCalc), fontSize = '12px'). The column headers and buttons have text…
tmesis
  • 347
  • 1
  • 3
  • 8
22
votes
4 answers

Button extension to download all data or only visible data

With the button extension to DT package, is there a way to specify that the buttons download either (1) all the data feeding the datatable, or (2) only the data on the visible page. Below is the example from the documentation. datatable( iris,…
Vlad
  • 3,058
  • 4
  • 25
  • 53
19
votes
2 answers

Shrink DT::dataTableOutput Size

I have a shiny interface, and I use DT::dataTableOutput and DT::renderDataTable a lot. However, I wonder if there's a way to shrink the datatable's size, e.g., making the font and the table smaller. How should I do this? Let's say I have the…
Miller Zhu
  • 697
  • 1
  • 7
  • 15
18
votes
2 answers

R shiny mouseover text for table columns

How can I create mouseover text for column names in R shiny data table display. I'm trying to provide some text for users to understand the column names. I checked in DT package also and I couldn't find a solution. I can create labels for column…
Sri
  • 1,130
  • 1
  • 15
  • 31
18
votes
4 answers

Add comma to numbers every three digits in datatable (R)

Suppose my data looks like this: df1 = data.frame(A=c(1000000.51,5000.33), B=c(0.565,0.794)) I want to use DataTables and have column A be (1,000,001 ; 5,000) library(DT) datatable(df1) %>% formatPercentage('B', 2) %>% formatRound('A',digits =…
Ignacio
  • 7,646
  • 16
  • 60
  • 113
17
votes
2 answers

Adding a vertical and horizontal scroll bar to the DT table in R shiny

Please check the data table "Case Analyses Details" on the right. I want to fit the data table within the box, such that it aligns from right and bottom border in the box, such that we add a horizontal and vertical scroll bar to the DT which can be…
Ashmin Kaul
  • 860
  • 2
  • 12
  • 37
1
2 3
99 100