Skip to contents

Overview

Get high-level documentation about the package

huxtable-package
Quick introduction to huxtable
huxtable-options
Package options
huxtable-FAQ
Frequently Asked Questions, including how to get help
huxtable-news
Changes to the huxtable package
rowspecs
Different ways to select rows and columns
mapping-functions mapping_functions
How to set cell properties variably by cell contents

Creating and manipulating huxtables

Create, subset, split and join huxtables

`[`(<huxtable>) `[<-`(<huxtable>) `$<-`(<huxtable>) `[[<-`(<huxtable>)
Subset a huxtable
add_colnames() add_rownames()
Add column or row names
add_footnote()
Add a row with a footnote
cbind(<huxtable>) rbind(<huxtable>)
Combine rows or columns
column_to_header()
Convert a column to header rows
huxtable() hux() tribble_hux()
Create a huxtable
as_huxtable() as_hux() is_huxtable() is_hux()
Convert objects to huxtables
insert_column() insert_row()
Insert a row or column
split_across() split_down()
Split a huxtable into multiple huxtables
restack_across() restack_down()
Restack huxtables across/down the page
add_rows() add_columns()
Insert one huxtable into another
mutate.huxtable()
Use dplyr verbs with huxtable objects
t(<huxtable>)
Transpose a huxtable

Size and position

Size and position properties

col_width() `col_width<-`() set_col_width()
Set the width of table columns
height() `height<-`() set_height()
Set the table height
position() `position<-`() set_position()
Set the table's position with respect to surrounding content
row_height() `row_height<-`() set_row_height()
Set the height of table rows
width() `width<-`() set_width()
Set the table width

Table-level properties

Other table-level properties

caption() `caption<-`() set_caption()
Set the table caption
caption_pos() `caption_pos<-`() set_caption_pos()
Position the table's caption
caption_width() `caption_width<-`() set_caption_width()
Set the width of the table caption
label() `label<-`() set_label()
Set a table label for external referencing
latex_float() `latex_float<-`() set_latex_float()
Set the position of the table float in LaTeX
tabular_environment() `tabular_environment<-`() set_tabular_environment()
Set the table's tabular environment in LaTeX
table_environment() `table_environment<-`() set_table_environment()
Set the "table" environment in LaTeX

Text properties

Style text in table cells

Borders and padding

Set borders, border colors and cell padding

left_border() right_border() top_border() bottom_border() `left_border<-`() `right_border<-`() `top_border<-`() `bottom_border<-`() set_left_border() set_right_border() set_top_border() set_bottom_border() map_left_border() map_right_border() map_top_border() map_bottom_border()
Set borders
left_border_color() right_border_color() top_border_color() bottom_border_color() `left_border_color<-`() `right_border_color<-`() `top_border_color<-`() `bottom_border_color<-`() set_left_border_color() set_right_border_color() set_top_border_color() set_bottom_border_color() map_left_border_color() map_right_border_color() map_top_border_color() map_bottom_border_color()
Set border colors
left_border_style() right_border_style() top_border_style() bottom_border_style() `left_border_style<-`() `right_border_style<-`() `top_border_style<-`() `bottom_border_style<-`() set_left_border_style() set_right_border_style() set_top_border_style() set_bottom_border_style() map_left_border_style() map_right_border_style() map_top_border_style() map_bottom_border_style()
Set border styles
left_padding() `left_padding<-`() set_left_padding() map_left_padding() right_padding() `right_padding<-`() set_right_padding() map_right_padding() top_padding() `top_padding<-`() set_top_padding() map_top_padding() bottom_padding() `bottom_padding<-`() set_bottom_padding() map_bottom_padding()
Cell padding
set_all_borders() map_all_borders() set_all_border_colors() map_all_border_colors() set_all_border_styles() map_all_border_styles() set_all_padding() map_all_padding() set_tb_padding() map_tb_padding() set_lr_padding() map_lr_padding() set_tb_borders() map_tb_borders() set_lr_borders() map_lr_borders() set_tb_border_colors() map_tb_border_colors() set_lr_border_colors() map_lr_border_colors() set_tb_border_styles() map_tb_border_styles() set_lr_border_styles() map_lr_border_styles()
Set left, right, top and bottom properties
set_outer_borders() set_outer_border_colors() set_outer_border_styles() set_outer_padding()
Set borders and padding around a rectangle of cells
brdr()
Create a border object
brdr_thickness()
Get thickness of a brdr() object

Layout

Change the layout of cells and tables

align() `align<-`() set_align() map_align()
Set the horizontal alignment of cell content
rowspan() `rowspan<-`() set_rowspan() map_rowspan() colspan() `colspan<-`() set_colspan() map_colspan()
Extend cells over multiple rows and/or columns
rotation() `rotation<-`() set_rotation() map_rotation()
Rotate text within cells
valign() `valign<-`() set_valign() map_valign()
Set the vertical alignment of cell content
wrap() `wrap<-`() set_wrap() map_wrap()
Wrap cell content over multiple lines
merge_across() merge_down()
Merge cells across rows or down columns
merge_cells()
Merge a range of cells
merge_repeated_rows()
Merge repeated rows into multirow cells

Property manipulation

Change multiple properties with one command, and set defaults

Mapping functions

Set cell properties depending on cell contents

by_cases()
Map cell contents to properties using case_when
by_colorspace()
Map numeric cell contents smoothly to colors
by_function()
Map cell contents to cell properties using a function or scale
by_quantiles() by_equal_groups()
Map numeric quantiles to cell properties
by_ranges()
Map numeric ranges to cell properties
by_regex()
Map cells matching a string or regex to cell properties
by_rows() by_cols()
Set cell properties by row or column
by_values()
Map specific cell values to cell properties

Printing

Print to LaTeX, HTML, Word, Excel, RTF, markdown or on-screen

as_flextable()
Convert a huxtable for Word/Powerpoint
as_Workbook()
Convert a huxtable for Excel
guess_knitr_output_format()
Guess knitr output format
print_html() print_notebook() to_html() as_html()
Create HTML representing a huxtable
print_latex() to_latex()
Create LaTeX representing a huxtable
print_md() to_md()
Create Markdown representing a huxtable
print_rtf() to_rtf()
Create RTF representing a huxtable
print_screen() to_screen()
Print a huxtable on screen
print_typst() to_typst()
Create Typst markup representing a huxtable
print(<huxtable>) format(<huxtable>)
Format and print huxtables using a default method
knit_print.huxtable()
Print a huxtable within knitr
knit_print.data.frame()
Print data frames in knitr using huxtable
rtf_fc_tables()
Create RTF font and color tables

Quick output

Print huxtables or other data to a new file, using a one-liner

quick_latex() quick_pdf() quick_typst() quick_typst_pdf() quick_typst_png() quick_typst_svg() quick_html() quick_docx() quick_pptx() quick_xlsx() quick_rtf()
Quickly print objects to a PDF, TeX, Typst, HTML, Microsoft Office or RTF document, or PNG or SVG images

Themes

Apply a coherent style to a huxtable

Row specs

Specify rows and columns in set_ functions

stripe() everywhere() evens() odds()
Return every n row or column numbers
final()
Return the last n rows or columns

LaTeX dependencies

Manage LaTeX packages for huxtable

Regression tables

Create a table of regressions

huxreg()
Create a huxtable to display model output
tidy_override() tidy_replace() tidy(<tidy_override>) glance(<tidy_override>) nobs(<tidy_override>)
Change a model's tidy output

Miscellaneous

Other functions

hux_logo()
Huxtable logo
jams
Prices of 3 jams
sanitize()
Escape text for various formats