Learn R Programming

h

u

x

t

a

b

l

e

Huxtable is an R package to create styled tables in multiple output formats, with a friendly, modern interface. Features include:

  • Control over text styling, number format, background colour, borders, padding and alignment.
  • Table cells can span multiple rows and/or columns.
  • Table manipulation via common dplyr functions.
  • Automatic formatting for rmarkdown and quarto documents.
  • huxreg() function for quick creation of regression tables.
  • Output to HTML, LaTeX, RTF, and Microsoft Word/Excel/Powerpoint, using the officer and openxlsx packages.
  • Output to PDF, PNG and SVG formats using typst.
  • Quick one-liners to print data frames into any supported format.
  • Formatted table display in the R console, including borders, colour, and text styles.

Installing

To install from r-universe:

install.packages("huxtable", repos = c(
  "https://hughjonesd.r-universe.dev",
  "https://cloud.r-project.org"
))

To install from CRAN:

install.packages("huxtable")

To install the latest version from github:

install.packages("remotes")
remotes::install_github("hughjonesd/huxtable")

Learning more

Check out the website, read the documentation or read the vignette.

Copy Link

Version

Install

install.packages('huxtable')

Monthly Downloads

10,524

Version

6.0.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

David Hugh-Jones

Last Published

September 15th, 2026

Functions in huxtable (6.0.1)

caption_pos

Position the table's caption
by_function

Map cell contents to cell properties using a function or scale
cbind.huxtable

Combine rows or columns
caption

Set the table caption
description-colors

Description of color format
huxreg

Create a huxtable to display model output
mutate.huxtable

Use dplyr verbs with huxtable objects
hux_prop_params

Shared documentation for huxtable property functions:
height

Set the table height
escape_contents

Escape or unescape text in cells
col_width

Set the width of table columns
[.huxtable

Subset a huxtable
left_border_color

Set border colors
header_cols

Mark rows or columns as headers
column_to_header

Convert a column to header rows
font

Set the font for cell text
huxtable-FAQ

Frequently Asked Questions, including how to get help
huxtable-news

Changes to the huxtable package
font_size

Make text larger or smaller
by_cases

Map cell contents to properties using case_when
huxtable

Create a huxtable
insert_column

Insert a row or column
latex_commands

LaTeX commands used by huxtables
html_css

Default CSS for HTML huxtables
latex_float

Set the position of the table float in LaTeX
fmt_percent

Format numbers as percent
cell_note

Set notes referenced from cells
mapping-functions

How to set cell properties variably by cell contents
mapping-params

Mapping parameters
note_symbol

Set the symbols used for cell note references
padding

Cell padding
number_format

Set how numbers are formatted in cells
rotation

Rotate text within cells
row_height

Set the height of table rows
span-overwrites-shadows

Section about colspan/rowspan
spans

Extend cells over multiple rows and/or columns
knit_print.huxtable

Print a huxtable within knitr
na_string

Change how NA values are printed
label

Set a table label for external referencing
merge_repeated_rows

Merge repeated rows into multirow cells
merge_across

Merge cells across rows or down columns
hux_logo

Huxtable logo
reexports

Objects exported from other packages
brdr

Create a border object
brdr_thickness

Get thickness of a brdr() object
huxtable-package

Quick introduction to huxtable
huxtable-options

Package options
quick-output

Quickly print objects to a PDF, TeX, Typst, HTML, Microsoft Office or RTF document, or PNG or SVG images
by_regex

Map cells matching a string or regex to cell properties
merge_cells

Merge a range of cells
by_rows

Set cell properties by row or column
final

Return the last n rows or columns
fmt-numbers

Description for fmt_ functions
stripes

Set background color stripes
fmt_pretty

Use prettyNum() to format numbers
t.huxtable

Transpose a huxtable
guess_knitr_output_format

Guess knitr output format
format.rtfFCTables

Format rtfFCTables
rtf_fc_tables

Create RTF font and color tables
rowspecs

Different ways to select rows and columns
print_latex

Create LaTeX representing a huxtable
report_latex_dependencies

Manage LaTeX dependencies for huxtables
print_md

Create Markdown representing a huxtable
sanitize

Escape text for various formats
position

Set the table's position with respect to surrounding content
[<-.brdr

Replace a subset of a brdr object
table_background_color

Set the table background color
style-functions

Set multiple properties on headers
markdown-note

Note about markdown vs. print_md()
markdown

Interpret cell content as markdown
print.huxtable

Format and print huxtables using a default method
knit_print.data.frame

Print data frames in knitr using huxtable
jams

Prices of 3 jams
set-multiple

Set left, right, top and bottom properties
text_color

Set the color of text in cells
table_environment

Set the "table" environment in LaTeX
tidy_override

Change a model's tidy output
restack-across-down

Restack huxtables across/down the page
set-outer

Set borders and padding around a rectangle of cells
print.rtfFCTables

Print rtfFCTables
print_html

Create HTML representing a huxtable
set_contents

Set cell contents
table_notes

Set notes beneath a table
themes

Theme a huxtable
print_typst

Create Typst markup representing a huxtable
tabular_environment

Set the table's tabular environment in LaTeX
valign

Set the vertical alignment of cell content
width

Set the table width
split-across-down

Split a huxtable into multiple huxtables
wrap

Wrap cell content over multiple lines
stripe

Return every n row or column numbers
set_default_properties

Default huxtable properties
print_rtf

Create RTF representing a huxtable
print_screen

Print a huxtable on screen
set_markdown_contents

Set cell contents, interpreting them as markdown
as_flextable

Convert a huxtable for Word/Powerpoint
add_rows

Insert one huxtable into another
background_color

Set cell background color
add_footnote

Add a row with a footnote (compatibility function)
as_Workbook

Convert a huxtable for Excel
align

Set the horizontal alignment of cell content
add_colnames

Add column or row names
as_huxtable

Convert objects to huxtables
bold

Make cell text bold or italic
left_border_style

Set border styles
by_ranges

Map numeric ranges to cell properties
by_quantiles

Map numeric quantiles to cell properties
breakable

Allow a table to break across pages
left_border

Set borders
by_colorspace

Map numeric cell contents smoothly to colors
caption_width

Set the width of the table caption
by_values

Map specific cell values to cell properties