79422474

Date: 2025-02-08 01:18:10
Score: 1
Natty:
Report link

Not sure if there is a more eloquent way but this works... It is a combination of modifying the padding options in gt and the margins in styles.css:

# r code
tab1 <- dat |> select(car,2:3) |> gt() |> tab_options(container.padding.y = px(0))
tab2 <- dat |> select(car,4:7) |> gt() |> tab_options(container.padding.y = px(0))
tab3 <- dat |> select(car,8:11) |> gt() |> tab_options(container.padding.y = px(0))
/* CSS */
.gt_table {
    margin-top: 0px !important;
    margin-bottom: 0px !important;
  }

Result:

three table final

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: seansteele