this.api().table().header() returns the <thead> node, and what you
were trying to do was to add the padding to the cells in the header,
which means you have to find the <th>'s in <thead>, e.g.
library(DT)
datatable(head(iris, 20), options = list(
initComplete = JS(
"function(settings, json) {",
"$(this.api().table().header()).find('th').css({'padding': '25px'});",
"}")
))
http://datatables.net/reference/api/table().header()
Regards,
Yihui