如何在Markdown针织衫中调整桌子尺寸

时间:2019-03-05 08:16:31

标签: r-markdown knitr expss

我正在尝试使用expss软件包,我遵循了一些示例,但是我的表很大。如何调整表格的大小,使其像链接中一样小?

有关链接中的表格,请参见:expss introduction

我的桌子边距很大:

enter image description here

我认为我需要更改设置,但是我不知道如何。我的设置是:

with

1 个答案:

答案 0 :(得分:0)

尝试使用htmlTable css.cell参数:

library(expss)
data(mtcars)
mtcars = apply_labels(mtcars,
                      mpg = "Miles/(US) gallon",
                      cyl = "Number of cylinders",
                      disp = "Displacement (cu.in.)",
                      hp = "Gross horsepower",
                      drat = "Rear axle ratio",
                      wt = "Weight (1000 lbs)",
                      qsec = "1/4 mile time",
                      vs = "Engine",
                      vs = c("V-engine" = 0,
                             "Straight engine" = 1),
                      am = "Transmission",
                      am = c("Automatic" = 0,
                             "Manual"=1),
                      gear = "Number of forward gears",
                      carb = "Number of carburetors"
)


cro(mtcars$am, mtcars$vs) %>% 
    htmlTable(css.cell = "padding: 0px;")