I am trying to create a table with a header that contains a similar gap. I'm not too ambitious here, and I don't care if I just broke very long lines or just had a two-line header in general.
dat <- matrix(round(rnorm(9, 20, 10)), 3, 3) colnames(dat) <- c("some very long colname","short","another toooooooolong colname") require(xtable) m <- xtable(dat) print(m, floating=FALSE, hline.after=NULL, size="\\footnotesize", tabular.environment="tabular", add.to.row=list(pos=list(-1,0,nrow(m),0 ), command=c('\\toprule ', '\\midrule ', '\\bottomrule', '\\\\ \\rowcolor[gray]{.9}' ) ) )
Is there a way for the line to break the header because my table no longer fits the page, although I already use landscape . Some kind of sanitize.rownames trick? Tucked around with \shortstack , but couldn't get it to go ...
source share