How to put a spacing of colors in a table of xtable?
Asked Answered
T

2

2

How to put a spacing of colors in a table of xtable?

I generate the tables with the following instructions:

test.table<-xtable(summary(test),caption='test', floating = FALSE)
align(test.table) <- "|c|l|"
print(test.table,caption.placement='top')

thanks for your answers

Toni answered 25/11, 2010 at 18:34 Comment(2)
Hey Ricardo, could you show us what you have now, and try to explain in more detail what you're looking to do with it?Griffen
What is test? What does spacing of colors mean?Puerperal
E
6

The html.table.attributes parameter needs a character vector of length equal to number of tables. This produces a bordered, centered table on a rather ugly yellow-orange background:

data(tli)
tli.table <- xtable(tli[1:20,])
digits(tli.table)[c(2,6)] <- 0
print(tli.table,type="html",
      html.table.attributes='border='1' align="center" bgcolor="#FFCC00"' )

And if you're targeting LaTeX use: tabular.environment=

Esdras answered 25/11, 2010 at 20:11 Comment(0)
M
1
html.table.attributes = list('border="1" bgcolor="#FFCC00"'))

will work!

Mammoth answered 11/3, 2014 at 7:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.