Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Specifying Column width #29
I am trying to adjust the column width for given columns. I am not sure what to use as the units on width or how to specify width.
On the DT site, it mentions it accepts any CSS value, I tried '30%',
I have also tried '150px', just a number like 200 (no quotes). Nothing changes the width.
What ever I specify for width displays the same out put.
DeptEditDT <- datatable( df, rownames=FALSE, extensions = list(Scroller=NULL, TableTools=NULL, FixedColumns=list(leftColumns=2)), options = list( dom = 'T<"clear">lfrtip', columnDefs = list(list(width = '20%', targets = list(2,3,4))), deferRender=TRUE, scrollX=TRUE,scrollY=400, scrollCollapse=TRUE, pageLength = 100, lengthMenu = c(10,50,100,200), tableTools=list(sSwfPath = copySWF('www'),aButtons=c('copy','csv','print')) ) )
In another section of code, I have a simpler DT and also tried to change the width here thinking the list of combined extensions was somehow getting in the way. Whatever I specify for width the column stays the same.
PrgEditDT<-datatable(df, rownames=FALSE, options = list(dom = 't', columnDefs = list(list(width = '40%', targets = list(2,3,4)))))
Does not work in my hand, do I miss something?: