Skip to main content

Installation

Tabulate is a header-only library, making it incredibly easy to integrate into your C++ project. There are several ways to use Tabulate depending on your project setup.

Requirements

Tabulate requires C++11 or later. The library supports C++17 features like std::variant and std::optional when available.
  • Minimum: C++11 compiler
  • Recommended: C++17 or later for optimal performance
  • Platform: Cross-platform (Linux, macOS, Windows)

Installation Methods

Choose the method that best fits your project:

Header-Only Installation

The simplest way to use Tabulate is to include the library directly in your project.
1

Clone the repository

git clone https://github.com/p-ranav/tabulate.git
2

Add to include path

Add the include/ directory to your compiler’s include path:
g++ -std=c++11 -I/path/to/tabulate/include my_program.cpp -o my_program
3

Include in your code

#include <tabulate/table.hpp>
using namespace tabulate;

int main() {
  Table my_table;
  // Start using Tabulate!
}
Just add include/ to your include_directories and you’re ready to go!

Compiler Configuration

GCC / Clang

# C++11
g++ -std=c++11 -I/path/to/tabulate/include main.cpp -o app

# C++17 (recommended)
g++ -std=c++17 -I/path/to/tabulate/include main.cpp -o app

MSVC

# C++11
cl /std:c++11 /I"path\to\tabulate\include" main.cpp

# C++17
cl /std:c++17 /I"path\to\tabulate\include" main.cpp

Building Examples

Tabulate includes numerous examples in the samples/ directory. To build them:
mkdir build
cd build
cmake -DSAMPLES=ON -DUSE_CPP17=ON ..
make
Then run any example:
./samples/movies
./samples/colors
./samples/unicode
Exploring the samples is a great way to learn Tabulate’s features!

Verification

Verify your installation with this simple program:
verify.cpp
#include <iostream>
#include <tabulate/table.hpp>

using namespace tabulate;

int main() {
  Table test;
  test.add_row({"Installation", "Successful!"});
  
  test[0].format()
    .font_color(Color::green)
    .font_style({FontStyle::bold});
  
  std::cout << test << std::endl;
  return 0;
}
Compile and run:
g++ -std=c++11 -I/path/to/tabulate/include verify.cpp -o verify
./verify
You should see a formatted table with green, bold text!

Next Steps

Quick Start Guide

Now that Tabulate is installed, learn how to create your first table

Build docs developers (and LLMs) love