Skip to contents

Style a flextable

Usage

style_ft(
  ft,
  header_font = "Lato",
  body_font = "Poppins",
  header_color = "#023B2C",
  header_text_color = "white",
  border_color = "#3E3D3D"
)

Arguments

ft

Flextable object.

header_font

Font of header text. Defaults to "Lato".

body_font

Font of body text. Defaults to "Poppins".

header_color

Background color of header cells. Defaults to WaSHI green.

header_text_color

Color of header text. Defaults to white.

border_color

Color of border lines. Defaults to WaSHI gray.

Value

Styled flextable object.

Examples

# Read in wrangled example table data
tables_path <- soils_example("tables.RDS")
tables <- readRDS(tables_path)

# Make the table
ft <- flextable::flextable(tables$biological)
ft

Field or Average

Organic Matter

Min C

POXC

PMN

ACE Protein

Field 01

4.5

36

500

67

6.7

Field 03

6.7

51

550

110

4.2

Hay/Silage Average
(14 Fields)

5.5

37

500

92

7.8

Pasture, Seeded Average
(16 Fields)

5.5

58

520

140

7.3

County 9 Average
(5 Fields)

4.7

50

490

79

5.3

Project Average
(100 Fields)

5.8

50

530

99

8.5

# Style the table style_ft(ft)

Field or Average

Organic Matter

Min C

POXC

PMN

ACE Protein

Field 01

4.5

36

500

67

6.7

Field 03

6.7

51

550

110

4.2

Hay/Silage Average
(14 Fields)

5.5

37

500

92

7.8

Pasture, Seeded Average
(16 Fields)

5.5

58

520

140

7.3

County 9 Average
(5 Fields)

4.7

50

490

79

5.3

Project Average
(100 Fields)

5.8

50

530

99

8.5