Style flextable::flextable
object according to APA style
Usage
apa_style(
x,
font_family = NULL,
font_size = 12,
text_color = "black",
border_color = "black",
border_width = 0.5,
line_spacing = 2,
horizontal_padding = 3,
table_align = "left",
header_align_vertical = c("top", "middle", "bottom"),
layout = "autofit",
table_width = 0,
markdown = TRUE,
markdown_header = markdown,
markdown_body = markdown,
no_markdown_columns = NULL,
no_markdown_columns_header = no_markdown_columns,
separate_headers = TRUE
)
Arguments
- x
object
- font_family
font family
- font_size
font size
- text_color
text color
- border_color
border color
- border_width
border width in pixels
- line_spacing
spacing between lines
- horizontal_padding
horizontal padding (in pixels)
- table_align
table alignment ("left", "center", "right")
- header_align_vertical
vertical alignment of headers. Can be "top", "middle", or "bottom"
- layout
table layout ("autofit", "fixed")
- table_width
table width (in pixels, 0 for auto)
- markdown
apply markdown formatting to header and body
- markdown_header
apply markdown formatting to header
- markdown_body
apply markdown formatting to body
- no_markdown_columns
body columns that should not be treated as markdown
- no_markdown_columns_header
column headers that should not be treated as markdown
- separate_headers
separate headers into column spanner labels
Examples
d <- data.frame(x = 1:3, y = 4:6)
flextable::flextable(d) |>
apa_style()
x
y
1
4
2
5
3
6