Reputation: 147
i want to reduce the height in the rows of a table building with tableOutput i tried with the next code, but not works
in UI.R
:
tableOutput("table"),tag$tr(tags$style(type="text/css", "#table {line-height:50%}"))
but not works, also i tried in server.R
output$table<- renderTable({
print(data())
},include.rownames=F,html.table.attributes=list(cellspacing="10px"))
but not works
Thanks
Upvotes: 2
Views: 2770
Reputation: 2936
A few things:
table
in ui.R
, it is actually the id of its container (a <div>
element), not the <table>
itself. line-height
attribute at <td>
level, so in order to override that, you have to set line-height
at <td>
level as well.Below is a working one:
tags$head(tags$style(type="text/css", "#table table td {line-height:50%;}"))
You can use this to replace your tags$tr(...)
part.
Upvotes: 2