I am using the package DT to create a datatable. I want to remove the table border. Any suggestions?
datatable(head(mtcars), rownames = NULL, colnames = NULL, options = list(dom = "t"))
I am using the package DT to create a datatable. I want to remove the table border. Any suggestions?
datatable(head(mtcars), rownames = NULL, colnames = NULL, options = list(dom = "t"))
I 'll provide an answer with tableHTML
that you might find useful for such a task:
library(tableHTML)
#create the HTML table. setting border to zero will remove borders
tableHTML(mtcars, headers = rep(' ', 11), rownames = FALSE, border = 0,
widths = rep('60', 11)) %>%
#add some css odd rows to keep zebra colouring. You can choose any colour you like
add_css_row(list('background-color', 'lightgray'), rows = even(1:nrow(mtcars)))
You can still change cell spacing, fonts, background colours or anything else you like with CSS using the add_css_*
functions.
Output: