huxtable v4.6.0


Monthly downloads



Easily Create and Style Tables for LaTeX, HTML and Other Formats

Like 'xtable', creates styled tables. Export to HTML, LaTeX, 'Word', 'Excel', 'PowerPoint' and RTF. Simple, modern interface to manipulate borders, size, position, captions, colours, text styles and number formatting. Table cells can span multiple rows and/or columns. Includes a 'huxreg' function for creation of regression tables, and 'quick_*' one-liners to print data to a new document.


x t
a b l e

CRAN Status
Badge CRAN Downloads Per
Month Travis-CI Build
Status AppVeyor Build
Status Coverage

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 standard R subsetting, or using dplyr.
  • Automatic formatting for knitr/rmarkdown 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.
  • Quick one-liners to print data frames into a new PDF, HTML page, RTF or Microsoft document.
  • Formatted table display in the R console, including borders, colour, and text styles.


To install from CRAN:


To install the latest version from github:


Learning more

Check out the website, read the documentation or read the vignette in HTML or PDF.

Fund huxtable development

If you find huxtable useful, fund me on Patreon.

Functions in huxtable

Name Description
by_cases Map cell contents to properties using case_when
caption Caption Print data frames in knitr using huxtable
left_padding Cell padding
mutate.huxtable Dplyr verbs for huxtable
rotation Text rotation
jams Prices of 3 jams
mapping-functions How to set cell properties variably by cell contents
col_width Column widths
by_values Map specific cell values to cell properties
caption_pos Caption position
by_regex Map cells matching a string or regex to cell properties
huxtable Create a huxtable
merge_cells Merge a range of cells
[.huxtable Subset a huxtable
insert_column Insert a row or column
final Return the last n rows or columns
na_string NA string
by_rows Set cell properties by row or column
by_quantiles Map numeric quantiles to cell properties
by_ranges Map numeric ranges to cell properties
reexports Objects exported from other packages
font Font
by_colorspace Map numeric cell contents smoothly to colors
rtf_fc_tables Create RTF font and color tables
sanitize Escape text for various formats
width Table width
report_latex_dependencies Tools for LaTeX dependencies
wrap Text wrapping
huxtable-FAQ Frequently Asked Questions
every Return every n row or column numbers
escape_contents Escape cell contents
hux_hex Deprecated functions
cbind.huxtable Combine rows or columns
guess_knitr_output_format Guess knitr output format
text_color Text color
print_latex Create LaTeX representing a huxtable
tabular_environment Tabular environment
print_html Create HTML representing a huxtable
by_function Map cell contents to cell properties using a function or scale
huxreg Create a huxtable to display model output
hux_logo Huxtable logo
font_size Font size
knit_print.huxtable Print a huxtable within knitr
label Table label
print.huxtable Default print method for huxtables
left_border Borders
latex_float Float position for LaTeX
rowspan Row and column span
set-multiple Set left, right, top and bottom properties
rowspecs Different ways to select rows and columns
themes Theme a huxtable
tidy_override Override a model's tidy output
set_cell_properties Set multiple cell properties
row_height Row heights
set_outer_borders Set borders around a rectangle of cells
height Table height
huxtable-package Huxtable: simply create LaTeX and HTML tables
huxtable-options Package options
left_border_color Border colors
print_md Create Markdown representing a huxtable
number_format Number format
print_rtf Create RTF representing a huxtable
left_border_style Border styles
position Table position
t.huxtable Transpose a huxtable
print_screen Print a huxtable on screen
valign Vertical alignment
quick-output Quickly print objects to a PDF, TeX, HTML, Microsoft Office or RTF document.
set_contents Set cell contents
set_default_properties Default huxtable properties
add_colnames Add column or row names
as_FlexTable Convert a huxtable for Word/Powerpoint
as_huxtable Convert objects to huxtables
add_rows Insert one matrix into another.
add_footnote Add a row with a footnote
bold Cell text style
background_color Background color
as_Workbook Convert a huxtable for Excel
align Alignment
No Results!

Vignettes of huxtable

No Results!

Last month downloads


Type Package
License MIT + file LICENSE
VignetteBuilder knitr
Encoding UTF-8
LazyData true
RoxygenNote 6.1.1
NeedsCompilation no
Packaged 2019-06-12 17:24:20 UTC; david
Repository CRAN
Date/Publication 2019-06-24 08:30:07 UTC

Include our badge in your README