| clin_row_height | R Documentation |
Regulatory outputs are usually specified to an exact row pitch, and the rendered height of a row is what decides how much fits on a page. flextable leaves rows at a nominal quarter inch with a rule of "auto", which lets the renderer size them however it likes. This records the pitch you want and applies it when the table renders.
clin_row_height(
x,
body = NULL,
title = NULL,
footnote = NULL,
header = NULL,
header_leading = NULL,
rule = c("atleast", "exact", "auto"),
unit = c("pt", "in", "cm", "mm")
)
x |
A clintable object |
body |
Row pitch for the table body |
title |
Row pitch for the title lines |
footnote |
Row pitch for the footnote lines, and for a footnote page |
header |
Row pitch for the column header rows. A floor under
|
header_leading |
Leading of the lines within the header, as a multiple
of single spacing - |
rule |
How the renderer should treat the pitch. |
unit |
Unit the pitches are given in. Row pitch is normally specified in points, so that is the default. |
The surfaces are set separately because they are separate tables: the table body, the column header, and the title and footnote blocks that go into the Word header and footer. Group label and caption rows, which clinify inserts while it renders, take the body pitch.
The column header has two levers rather than one, and they do different
things. header bounds the header rows the same way body bounds the body
rows, so with the default rule = "atleast" it is a floor: a header cell
holding three lines still grows past it. header_leading is what closes the
gap between those lines, so it is the one to reach for when a wrapped arm
label sits looser than a reference output. They can be used together.
Called a second time, this refines what the first call set rather than replacing it: arguments this call does not name keep their earlier value. So a house wide pitch can be set once and a single table can add an exception without restating the rest.
The height is applied to whole parts, so it is a pitch for every row of the
surface rather than a per-row height. Anything already set with
flextable::height() or flextable::height_all() is replaced. Because the
pitch is applied after the default styling functions run, it also holds when
an organisation's clinify_table_default() sets a house pitch of its own -
the table's own setting wins.
A clintable object
clintable(mtcars) |>
clin_row_height(body = 15.35, title = 11.4, footnote = 11.4)
# Or in inches
clintable(mtcars) |>
clin_row_height(body = 0.213, unit = "in")
# A wrapped header label sitting too loose: bound the header rows and close
# up the lines inside them
clintable(mtcars) |>
clin_column_headers(mpg = "Miles\nper\ngallon") |>
clin_row_height(header = 13, header_leading = 0.75)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.