我如何适合一个非常宽的 grid.table 或 tableGrob 以适合 pdf 页面? [英] How do I fit a very wide grid.table or tableGrob to fit on a pdf page?
本文介绍了我如何适合一个非常宽的 grid.table 或 tableGrob 以适合 pdf 页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个相当宽的表格(页面宽度的 4/3),我正在尝试使用 grid.table 或 grid.arrange(通过 tableGrob)将其打印成 pdf 文件.表格超出页面边界并被剪裁.有没有办法强制 grid.table/grid.arrange 将表格缩放到打印区域?
I have a fairly wide table (4/3 of page width) that I'm trying to print using grid.table or grid.arrange (via tableGrob) into a pdf file. The table goes beyond page boundaries and gets clipped. Is there a way to force grid.table/grid.arrange to scale the table to the print area?
推荐答案
我使用字体大小完成了这项工作.不是最好的解决方案(需要人工干预),但也许有人可以贡献一些更优雅的东西.
I got this done using font sizes. Not the best solution (requires manual intervention) but maybe someone can contribute something more elegant.
termTable = tableGrob(terms, h.even.alpha=1, h.odd.alpha=1, v.even.alpha=0.5, v.odd.alpha=1, core.just='left', rows=c(),
gpar.coretext =gpar(fontsize=8),
gpar.coltext=gpar(fontsize=10, fontface='bold'),
gpar.rowtext=gpar(fontsize=10, fontface='bold')
)
这篇关于我如何适合一个非常宽的 grid.table 或 tableGrob 以适合 pdf 页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文