Functions for Tabular Reporting

Create pretty tables for 'Microsoft Word', 'Microsoft PowerPoint' and 'HTML' documents. Functions are provided to let users create tables, modify and format their content. It extends package 'officer' that does not contain any feature for customized tabular reporting and can be used with R Markdown documents. It also work within R markdown documents when rendering to HTML and to 'Microsoft Word' documents.

BuildStatus Buildstatus CRAN_Status_Badge cranlogs codecov Project Status: Active – The project has reached a stable, usablestate and is being activelydeveloped.

The flextable package provides a framework for easily create tables for reporting. Tables can be embedded within:

  • R Markdown documents
  • Microsoft Word or PowerPoint documents.

Getting Started

An API is available to let R users create tables for reporting and control their formatting properties and their layout. A flextable object is a data.frame representation, it can be manipulated with functions that give control over:

  • headers content
  • text, paragraphs, cells and border formatting of any element
  • displayed values

There are articles on the flextable website that will help you get you to start quickly:

The help pages can be read here.



You can get the development version from GitHub:



Online documentation

The help pages are located at

Getting help

This project is developped and maintained on my own time. In order to help me to maintain the package, do not send me private emails if you only have questions about how to use the package. Instead, visit Stackoverflow and use tags flextable and r Stackoverflow link! I usually read them and answer when possible.

Contributing to the package

Code of Conduct

Anyone getting involved in this package agrees to our Code of Conduct.

Bug reports

When you file a bug report, please spend some time making it easy for me to follow and reproduce. The more time you spend on making the bug report coherent, the more time I can dedicate to investigate the bug as opposed to the bug report.

Contributing to the package development

A great way to start is to contribute an example or improve the documentation.

If you want to submit a Pull Request to integrate functions of yours, please provide:

  • the new function(s) with code and roxygen tags (with examples)
  • a new section in the appropriate vignette that describes how to use the new function
  • add corresponding tests in directory tests/testthat.

By using rhub (run rhub::check_for_cran()), you will see if everything is ok. When submitted, the PR will be evaluated automatically on travis and appveyor and you will be able to see if something broke.


flextable 0.4.2

new features

  • new function xtable_to_flextable() that is returning a flextable from an xtable object.
  • function htmltools_value() is exported for shiny applications.

flextable 0.4.1

new features

  • flextables have now a footer part

flextable 0.4.0

new features

  • new function knit_print() to render flextable in rmarkdown.


  • function tabwid() is deprecated in favor of a knit_print implementation.
  • list of dependencies has been reduced.

flextable 0.3

new features

  • new function regulartable, faster and simpler than flextable


  • characters <, > and & are now html encoded
  • fix columns widths when output format is HTML

flextable 0.2

new features

  • new function ph_with_flextable_at to add a flextable at any position in a slide.
  • new function merge_at is providing a general way of merging cells.
  • new theme function: theme_box()


  • function display() now works with a mustache template


  • fix fontsize when part == "all"

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.4.4 by David Gohel, 2 months ago

Report a bug at

Browse source code at

Authors: David Gohel [aut, cre], Maxim Nazarov [ctb] (rmarkdown for docx output)

Documentation:   PDF Manual  

GPL-3 license

Imports stats, utils, grDevices, officer, rmarkdown, knitr, htmltools, R6, stringr, gdtools

Suggests xml2, testthat, xtable

Imported by SWMPrExtension, WordR.

Suggested by huxtable, munsellinterpol.

See at CRAN