更新时间:2022-12-21 21:14:11
尝试一下
#OUTPUT - dtdata
output$table <- DT::renderDataTable({
data.frame(a=c(1,2,3,4,5),b=c("A","B","C","D","E"))
},
options = list(
autoWidth = TRUE,
columnDefs = list(list(width = '200px', targets = "_all"))
))
将所有列的宽度设置为200px。
Sets the width of all columns to 200px.
要设置选定列的宽度,请将目标
更改为数字或向量。
To set width of selected columns, change targets
to a number or vector.
targets = c(1,3)