【发布时间】:2020-02-26 01:58:14
【问题描述】:
尝试从 R 中的 DT:datatable 中删除页脚边框。
看着这个datatable,我发现下面的代码可以消除列名(为空的“”)和数据之间的边界(用红色表示):
headerCallback <- c(
"function(thead, data, start, end, display){",
" $('th', thead).css('border-bottom', 'none');",
"}"
),
DT::datatable(
data = myData(),
class = "compact",
rownames = FALSE,
colnames = c("",""),
caption = tags$caption(myTitle, style = "color:black"),
options = list(
dom = 't',
ordering = FALSE,
paging = FALSE,
searching = FALSE,
headerCallback = JS(headerCallback)
)
)
})
我现在要做的是消除图像中底部的黑线。我发现以下链接似乎是我正在寻找的内容,但现在确定如何将它们合并到我所拥有的内容中:
r - How to remove the horizontal line between the header and the body in a DT::datatable
当我检查网页上的元素并展开<table> 时,我可以取消选中this box,它会删除底部的黑线并给我想要的东西。但是,不确定如何将其写入我现有的或新的回调函数中。
【问题讨论】:
标签: javascript css r shiny dt