【问题标题】:How to put a spacing of colors in a table of xtable?如何在xtable的表格中放置颜色间距?
【发布时间】:2010-11-25 18:34:30
【问题描述】:

如何在xtable的表格中放置颜色间距?

我使用以下说明生成表格:

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

感谢您的回答

【问题讨论】:

  • 嗨,Ricardo,您能告诉我们您现在拥有什么,并尝试更详细地解释您希望用它做什么吗?
  • 什么是testspacing of colors 是什么意思?

标签: r latex bigtable sweave xtable


【解决方案1】:

html.table.attributes 参数需要一个长度等于表数的字符向量。这会在相当难看的黄橙色背景上生成一个带边框的居中表格:

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"' )

如果您的目标是 LaTeX,请使用:tabular.environment=

【讨论】:

    【解决方案2】:
    html.table.attributes = list('border="1" bgcolor="#FFCC00"'))
    

    会起作用的!

    【讨论】:

      猜你喜欢
      • 2017-01-20
      • 1970-01-01
      • 1970-01-01
      • 2017-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多