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.
Arguments
- 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
rule = "atleast", so a header cell of several lines still grows- header_leading
Leading of the lines within the header, as a multiple of single spacing -
0.75draws them three quarters as far apart. This is the only measurement here that is not a length, because flextable and Word both express leading as a multiple, sounitdoes not apply to it- rule
How the renderer should treat the pitch.
"atleast"(the default) makes it a floor, so a cell whose text wraps grows past it instead of being clipped."exact"pins the row to the pitch and clips anything that does not fit, which is the only way to get a pitch at or below the font's line height."auto"lets the renderer decide, ignoring the pitch.- unit
Unit the pitches are given in. Row pitch is normally specified in points, so that is the default.
Details
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.
Examples
clintable(mtcars) |>
clin_row_height(body = 15.35, title = 11.4, footnote = 11.4)
mpg
cyl
disp
hp
drat
wt
qsec
vs
am
gear
carb
21.0
6
160.0
110
3.90
2.620
16.46
0
1
4
4
21.0
6
160.0
110
3.90
2.875
17.02
0
1
4
4
22.8
4
108.0
93
3.85
2.320
18.61
1
1
4
1
21.4
6
258.0
110
3.08
3.215
19.44
1
0
3
1
18.7
8
360.0
175
3.15
3.440
17.02
0
0
3
2
18.1
6
225.0
105
2.76
3.460
20.22
1
0
3
1
14.3
8
360.0
245
3.21
3.570
15.84
0
0
3
4
24.4
4
146.7
62
3.69
3.190
20.00
1
0
4
2
22.8
4
140.8
95
3.92
3.150
22.90
1
0
4
2
19.2
6
167.6
123
3.92
3.440
18.30
1
0
4
4
17.8
6
167.6
123
3.92
3.440
18.90
1
0
4
4
16.4
8
275.8
180
3.07
4.070
17.40
0
0
3
3
17.3
8
275.8
180
3.07
3.730
17.60
0
0
3
3
15.2
8
275.8
180
3.07
3.780
18.00
0
0
3
3
10.4
8
472.0
205
2.93
5.250
17.98
0
0
3
4
# Or in inches
clintable(mtcars) |>
clin_row_height(body = 0.213, unit = "in")
mpg
cyl
disp
hp
drat
wt
qsec
vs
am
gear
carb
21.0
6
160.0
110
3.90
2.620
16.46
0
1
4
4
21.0
6
160.0
110
3.90
2.875
17.02
0
1
4
4
22.8
4
108.0
93
3.85
2.320
18.61
1
1
4
1
21.4
6
258.0
110
3.08
3.215
19.44
1
0
3
1
18.7
8
360.0
175
3.15
3.440
17.02
0
0
3
2
18.1
6
225.0
105
2.76
3.460
20.22
1
0
3
1
14.3
8
360.0
245
3.21
3.570
15.84
0
0
3
4
24.4
4
146.7
62
3.69
3.190
20.00
1
0
4
2
22.8
4
140.8
95
3.92
3.150
22.90
1
0
4
2
19.2
6
167.6
123
3.92
3.440
18.30
1
0
4
4
17.8
6
167.6
123
3.92
3.440
18.90
1
0
4
4
16.4
8
275.8
180
3.07
4.070
17.40
0
0
3
3
17.3
8
275.8
180
3.07
3.730
17.60
0
0
3
3
15.2
8
275.8
180
3.07
3.780
18.00
0
0
3
3
10.4
8
472.0
205
2.93
5.250
17.98
0
0
3
4
# 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)
Miles
per
gallon
21.0
6
160.0
110
3.90
2.620
16.46
0
1
4
4
21.0
6
160.0
110
3.90
2.875
17.02
0
1
4
4
22.8
4
108.0
93
3.85
2.320
18.61
1
1
4
1
21.4
6
258.0
110
3.08
3.215
19.44
1
0
3
1
18.7
8
360.0
175
3.15
3.440
17.02
0
0
3
2
18.1
6
225.0
105
2.76
3.460
20.22
1
0
3
1
14.3
8
360.0
245
3.21
3.570
15.84
0
0
3
4
24.4
4
146.7
62
3.69
3.190
20.00
1
0
4
2
22.8
4
140.8
95
3.92
3.150
22.90
1
0
4
2
19.2
6
167.6
123
3.92
3.440
18.30
1
0
4
4
17.8
6
167.6
123
3.92
3.440
18.90
1
0
4
4
16.4
8
275.8
180
3.07
4.070
17.40
0
0
3
3
17.3
8
275.8
180
3.07
3.730
17.60
0
0
3
3
15.2
8
275.8
180
3.07
3.780
18.00
0
0
3
3
10.4
8
472.0
205
2.93
5.250
17.98
0
0
3
4