Reputation: 11676
I have a Shiny data table that I am trying to right align. The data table has 2 columns.
I am using the following options:
,options= list(paging = FALSE, searching = FALSE, sorting = FALSE, bFilter = FALSE, bSort = FALSE, bInfo = FALSE, bAutoWidth = TRUE,
aoColumnDefs = list(list(sClass="alignRight",aTargets=c(list(1), list(2))))
What am I missing
Upvotes: 4
Views: 2170
Reputation: 21425
You could add a rowCallback
function to your list of options to align the text to the right using CSS (there doesn't seem to be any rightAlign
or dt-right
class styles in the CSS stylesheets loaded by shiny):
rowCallback = I(
'function(row, data) {
$("td", row).css("text-align", "right");
}'
)
Upvotes: 1