【问题标题】:Increasing the height of table rows in R增加R中表格行的高度
【发布时间】:2018-06-01 16:37:23
【问题描述】:

请检查下面的 R 代码和快照,我想增加表格中行的高度。

library(DT)
datatable(head(iris), rownames = FALSE)

为了在 css 中实现这一点,您可以使用:

#example tr td {
height: 894px;
}

【问题讨论】:

    标签: html css r dt


    【解决方案1】:

    您可以使用formatStyle()更改行高:

    library(DT)
    
    datatable(head(iris), rownames = FALSE) %>%
      formatStyle(names(iris), # select all columns in table
                  height = 894) # set height of rows
    

    输出如下所示(仅前 2 行):

    【讨论】:

    • 非常感谢您的回复,不过,我自己想通了,我使用了 font-size 参数来减小行和文本大小。
    • 关于在这篇文章中显示 DT 表中的数据,我需要您的帮助,请查看。 stackoverflow.com/questions/47951307/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-01-09
    • 2017-06-23
    • 1970-01-01
    • 1970-01-01
    • 2016-08-14
    • 2020-09-06
    • 2020-10-18
    相关资源
    最近更新 更多