Modify the options available in a table. These options are named by the components, the subcomponents, and the element that can adjusted.

tab_options(data, container.width = NULL, container.height = NULL,
container.overflow.x = NULL, container.overflow.y = NULL,
table.width = NULL, table.align = NULL, table.margin.left = NULL,
table.margin.right = NULL, table.font.size = NULL,
table.background.color = NULL, table.border.top.style = NULL,
table.border.top.width = NULL, table.border.top.color = NULL,
column_labels.background.color = NULL,
column_labels.font.size = NULL, column_labels.font.weight = NULL,
column_labels.hidden = NULL, row_group.background.color = NULL,
row_group.font.size = NULL, row_group.font.weight = NULL,
row_group.border.top.style = NULL, row_group.border.top.width = NULL,
row_group.border.top.color = NULL,
row_group.border.bottom.style = NULL,
row_group.border.bottom.width = NULL,
row_group.border.bottom.color = NULL,
table_body.border.top.style = NULL,
table_body.border.top.width = NULL,
table_body.border.top.color = NULL,
table_body.border.bottom.style = NULL,
table_body.border.bottom.width = NULL,
table_body.border.bottom.color = NULL, row.padding = NULL,
summary_row.background.color = NULL, summary_row.padding = NULL,
summary_row.text_transform = NULL,
grand_summary_row.background.color = NULL,
grand_summary_row.text_transform = NULL, footnote.sep = NULL,
footnote.marks = NULL, footnote.font.size = NULL,
footnote.padding = NULL, sourcenote.font.size = NULL,
sourcenote.padding = NULL, row.striping.include_stub = NULL,
row.striping.include_table_body = NULL)

## Arguments

data A table object that is created using the gt() function. The width and height of the table's container. Can be specified as a single-length character with units of pixels or as a percentage. If provided as a single-length numeric vector, it is assumed that the value is given in units of pixels. The px() and pct() helper functions can also be used to pass in numeric values and obtain values as pixel or percent units. Options to enable scrolling in the horizontal and vertical directions when the table content overflows the container dimensions. Using TRUE (the default for both) means that horizontal or vertical scrolling is enabled to view the entire table in those directions. With FALSE, the table may be clipped if the table width or height exceeds the container.width or container.height. The width of the table. Can be specified as a single-length character with units of pixels or as a percentage. If provided as a single-length numeric vector, it is assumed that the value is given in units of pixels. The px() and pct() helper functions can also be used to pass in numeric values and obtain values as pixel or percent units. The alignment of the table in its container. By default, this is "center". Other options are "left" and "right". This will automatically set table.margin.left and table.margin.right to the appropriate values. The size of the margins on the left and right of the table within the container. Can be specified as a single-length character with units of pixels or as a percentage. If provided as a single-length numeric vector, it is assumed that the value is given in units of pixels. The px() and pct() helper functions can also be used to pass in numeric values and obtain values as pixel or percent units. Using table.margin.left or table.margin.right will overwrite any values set by table.align. Font sizes for the parent text element table and the following child elements: heading.title, heading.subtitle, columns, row_group, footnote, and sourcenote. Can be specified as a single-length character vector with units of pixels (e.g., 12px) or as a percentage (e.g., 80\%). If provided as a single-length numeric vector, it is assumed that the value is given in units of pixels. The px() and pct() helper functions can also be used to pass in numeric values and obtain values as pixel or percent units. background colors for the parent element table and the following child elements: heading, columns, row_group, summary_row, and table_body. A color name or a hexadecimal color code should be provided. The style, width, and color of the table's top border. The style, width, and color of the heading's bottom border. the font weight of the columns and row_group text element. An option to hide the column labels. The style, width, and color of the row group's top border. The style, width, and color of the row group's bottom border. The style, width, and color of the table body's top border. the style, width, and color of the table body's bottom border. the amount of padding in each row and in each type of summary row. an option to apply text transformations to the label text in each summary row. the separating characters between adjacent footnotes in the footnotes section. The default value produces a linebreak. The set of sequential marks used to reference and identify each of the footnotes (same input as the opt_footnote_marks() function. We can supply a vector that represents the series of footnote marks. This vector is recycled when its usage goes beyond the length of the set. At each cycle, the marks are simply combined (e.g., * -> ** -> ***). The option exists for providing keywords for certain types of footnote marks. The keyword "numbers" (the default, indicating that we want to use numeric marks). We can use lowercase "letters" or uppercase "LETTERS". There is the option for using a traditional symbol set where "standard" provides four symbols, and, "extended" adds two more symbols, making six. The amount of padding to apply to the footnote and source note sections. An option for whether to include the stub when striping rows. An option for whether to include the table body when striping rows.

## Value

an object of class gt_tbl.

## Figures

Other table-part creation/modification functions: gt_preview, gt, tab_footnote, tab_header, tab_row_group, tab_source_note, tab_spanner, tab_stubhead, tab_style

## Examples

# Use exibble to create a gt table with
# all the main parts added; we can use this
# going forward to demo some tab_options()
tab_1 <-
exibble %>%
dplyr::select(
-c(fctr, date, time, datetime)
) %>%
gt(
rowname_col = "row",
groupname_col = "group"
) %>%
title = md("Data listing from **exibble**"),
subtitle = md("exibble is an R dataset")
) %>%
fmt_number(columns = vars(num)) %>%
fmt_currency(columns = vars(currency)) %>%
tab_footnote(
footnote = "Using commas for separators.",
locations = cells_data(
columns = vars(num),
rows = num > 1000)
) %>%
tab_footnote(
footnote = "Using commas for separators.",
locations = cells_data(
columns = vars(currency),
rows = currency > 1000)
) %>%
tab_footnote(
footnote = "Alphabetical fruit.",
locations = cells_column_labels(
columns = vars(char))
)

# Modify the table width to 100% (which
# spans the entire content width area)
tab_2 <-
tab_1 %>%
tab_options(
table.width = pct(100)
)

# Modify the table's background color
# to be "lightcyan"
tab_3 <-
tab_1 %>%
tab_options(
table.background.color = "lightcyan"
)

# Use letters as the marks for footnote
# references; also, separate footnotes in
# the footer by spaces instead of newlines
tab_4 <-
tab_1 %>%
tab_options(
footnote.sep = " ",
footnote.marks = letters
)

# Change the padding of data rows to 5px
tab_5 <-
tab_1 %>%
tab_options(
)