Reputation: 1939
How do I align all tables in grid.arrange
to top? The tables seem to mid-align by default.
df1 = data.frame(x=c(1, 2, 3), y=c('a', 'b', 'c'))
df2 = data.frame(x=rep(1, 10), y=rep('a', 10))
grid.arrange(tableGrob(df1), tableGrob(df2),
nrow=1, ncol=2)
Upvotes: 4
Views: 953
Reputation: 7153
g1 <- tableGrob(df1)
g2 <- tableGrob(df2)
grid.draw(combine(g1, g2, along=1))
Upvotes: 5