1

I'm trying to use a package expss, and I followed some of the examples, but my table is huge. How can I adjust the table so that it is small, like in the link?

For the tables in the link please see: expss introduction

My tables have wide margins:

enter image description here

I think I need to make changes to the setup, but I don't know how. My set up is:

library(knitr)
knitr::opts_chunk$set(echo = TRUE)
halo09876
  • 2,725
  • 12
  • 51
  • 71

1 Answers1

0

Try to use htmlTable css.cell argument:

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;")
Gregory Demin
  • 4,596
  • 2
  • 20
  • 20
  • Thank you! I'm still having trouble decreasing the cell margin sizes -- it seems that the whole table won't shrink. I tried `htmlTable(css.cell = "padding: 0px; padding-right:0px; padding-left:0px")` – halo09876 Mar 05 '19 at 17:28
  • I also realized it doesn't have to do with font size -- I tried ` – halo09876 Mar 05 '19 at 17:40