在输出中为 DT table 保持相同的行高

keeping same height of row for DT table in output

我想为 DT table 输出设置常量或固定的行高。对于下面的 table,您可以看到行高的差异。

所以情况是当字符数增加时,例如第二行,在这种情况下,第一列的高度应该调整为与所有行相同。

df <- data.frame(`quote` = c("the trader belongs to","trader have long ralationship withthe same market with my opinion on thaw its implemented mmnnhhh sdfghj fghj kjhgf tyui cvbnm",
                             "types of trads happens everytime when market slow","trades have leverage with",
                             "market is continious with the same platform trades"),
                 `share`= c(43,65,92,23,73),
                 `times` = c(86,98,55,12,08),
                 `parts`=c(4,7,4,8,3))


df<-datatable(df,
              options = list(columnDefs = 
                               list(list(className = 'dt-center', 
                                         targets = "_all"))),rownames = FALSE)
df

就像在 flextable 中一样,我可以做类似下面的事情,但正在寻找 DT tables 的固定解决方案或任何功能。

(ncols %in% c(4,5)) {
    fl<-width(flxtable, width = d*0.3, j = 1)
    fl<-width(flxtable, width = (d*0.7)/(ncols-1), j = 2:ncols)
d is left and right margin of docs template

我过去曾成功过:

DT::datatable(df) %>%
DT::formatStyle(names(df),lineHeight='80%') 

感谢 post 对我的帮助,但我现在找不到了。