My question relates to the answer by Baptiste that you can find here: https://stackoverflow.com/a/18667413/2072440.
That code does pretty what I want it to do. I wou
I've added a table function in gtable, with more options.
It's really slow, unfortunately (and unsurprisingly for grid graphics).
require(gtable)
d <- head(iris, 3)
core <- gtable_table(d,
fg.par = list(col=1:8, hjust=0, x=0.1),
bg.par = list(fill=9:15, alpha=0.5))
colhead <- gtable_table(t(colnames(d)), fg.par = list(fontface=4),
bg.par = list(col=NA))
rowhead <- gtable_table(c("", rownames(d)), fg.par = list(fontface=3),
bg.par = list(col=NA))
g <- rbind(colhead, core)
g <- cbind(rowhead, g)
grid.newpage()
grid.draw(g)