如何将kable标题/字幕集中在r左右对齐时
我想将表格的标题(标题)居中为中心,但是分配了列的值。我还希望我的字幕分为两行,每行都被居中。
Align
选项以相同的方式更改两个。
head(mtcars) %>%
kbl(caption = "{first row\\\\
second row}",
align = "l") %>%
kable_styling()
I want to have the title(caption) of the table centered, but the values of columns left assigned. I also want my caption to be broken into two lines and each line to be centered.
align
option changes both of them in a same way.
head(mtcars) %>%
kbl(caption = "{first row\\\\
second row}",
align = "l") %>%
kable_styling()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许这会有所帮助:
结果:
更新
我假设您正在尝试以HTML格式生产表。为了中心标题并在字幕文本上放置线路断开,您可以使用HTML元素:
<中心>
用于中心和< br>
进行折断。结果:
参考
Maybe this helps:
The result:
Update
I assume that you are trying to produce a table in html format. To center the caption and put a line break on the caption texts, you can use html elements:
<center>
for centering and<br>
for line breaking.The result:
References