我正在尝试设置'F'列的宽度以删除列之间的间隔。我正在使用columnDef width,但是看起来有一个最小宽度(在img中显示)。
我可以强迫宽度变小吗?
表格:
datatable(data = data, class = 'stripe', rownames = FALSE, filter = 'bottom', escape = FALSE, extensions = c('Scroller'),
options = list(dom = 'Rlfrtip', autoWidth = TRUE, scrollX = TRUE, scrollY = 350, pagelength=50, lengthMenu = c(50,100,200,400),
initComplete = JS(
"function(settings, json) {",
"$(this.api().table().header()).css({'background-color': '#0892d0', 'color': '#fff'});",
"}"
),
columnDefs = list(
list(width = '20px', className = 'dt-center', targets = c(0))
)
)
) %>% DT::formatCurrency(
columns = 'Importe', currency = ' €', dec.mark = ',', mark = '.', digits = 2, before = FALSE
)