将xtable与longtable选项一起使用时重复标题 [英] Repeat headers when using xtable with longtable option

查看:114
本文介绍了将xtable与longtable选项一起使用时重复标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在生成带有longtable选项的xtable时,是否可以重复顶部行/set标头?

Is there a way to repeat the top row / set headers when generating an xtable with a longtable option ?

例如,如果我有

tableSb <- xtable(df, caption="A Very Long Table", label="ALongTable")
print(tableSb, include.rownames=TRUE, tabular.environment="longtable", floating=FALSE)

这很好,但是当表翻转到新页面时,标题将不会重复.有什么建议吗?

This works fine, but when the tables roll over into a new page the headers are not repeated. Any suggestions ?

推荐答案

为此,您需要使用print函数的add.to.row选项(有关更多信息,请运行?print.xtable).

In order to accomplish this, you'll need to use the add.to.row option of the print function (run ?print.xtable for more information).

尝试一下(改编自

解决方案有点笨拙,但至少它将为您提供大量自定义功能.

It's a bit clumsy of a solution, but at least it'll provide you with plenty of customization.

这篇关于将xtable与longtable选项一起使用时重复标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆