簡體   English   中英

如何在Kable中縮小列寬和表大小(type = rmarkdown)

[英]How to Shrink Column Width and Table Size In Kable(type = rmarkdown)

我在rmarkdown制作幻燈片,當我使用時

 kable(tablename)

柱子調整,使桌子適合整個幻燈片。

我希望列以某種方式更小的固定大小。 通過圍繞文本/數字的寬度包裝列,或聲明固定寬度。

另外,我不介意縮小整個表格的尺寸。

我想避免使用其他軟件包,只想知道如何使用kable。

我通過使用latex命令和minipage包來編織.pdf時這樣做。 我認為你不必安裝它。

\centering
\begin{minipage}{0.4\textwidth}
```{r}
Use your kable command here to create your first table

knitr::kable(data[c(rownum),],format = "latex")
```
\end{minipage}
\begin{minipage}{0.4\textwidth}
```{r}
Use your kable command here to create your second table

knitr::kable(data[c(rownum),],format = "latex")
```
\end{minipage}
\flushleft

\\ centering和\\ flushleft命令是您的偏好,並按照您的期望行事。 兩個小型命令將並排放置表格。 你可以放置兩個以上的byt來使用{0.4 \\ textwidth}部分,這意味着允許表占用文本寬度的0.4。

希望這可以幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM