How gt tables are constructed and rendered
masterThe gt workflow follows a consistent pattern:
- Table Data: Start with a
tibbleordata.frame. - Composition: Use
gt()to create the table object, then compose it using a cohesive set of table parts such as the table header, stub, column labels, spanner column labels, table body, and table footer. - Rendering: Render the table by printing it to the console, including it in an R Markdown document, or exporting it to a file using
gtsave().
Supported output formats include HTML, LaTeX, and RTF.