🌐
PyPI
pypi.org › project › tabulate
tabulate · PyPI
Pretty-print tabular data in Python, a library and a command-line utility.
      » pip install tabulate
    
Published   Mar 04, 2026
Version   0.10.0
🌐
Python for Network Engineers
pyneng.readthedocs.io › en › latest › book › 12_useful_modules › tabulate.html
tabulate - Python for network engineers
tabulate documentation · Articles from author tabulate: Pretty printing tables in Python · Tabulate 0.7.1 with LaTeX & MediaWiki tables · Stack Overflow: Printing Lists as Tabular Data. Note the answer - it contains other tabulate analogues. Contents · tabulate ·
🌐
DataCamp
datacamp.com › tutorial › python-tabulate
Python Tabulate: A Full Guide | DataCamp
September 5, 2024 - The tabulate library provides a command-line utility to help you display tables directly from the command line or terminal. This command-line utility allows you to generate the tables without writing additional Python code.
🌐
GitHub
github.com › gregbanks › python-tabulate
GitHub - gregbanks/python-tabulate: fork of https://bitbucket.org/astanin/python-tabulate · GitHub
=========================== ========== =========== Table formatter time, μs rel. time =========================== ========== =========== join with tabs and newlines 22.6 1.0 csv to StringIO 31.6 1.4 asciitable (0.8.0) 777.6 34.4 tabulate (0.7.2) 1374.9 60.9 PrettyTable (0.7.2) 3640.3 161.2 texttable (0.8.1) 3901.3 172.8 =========================== ========== =========== ... 0.7: latex tables. Printing lists of named tuples and NumPy record arrays. Fix printing date and time values. Python <= 2.6.4 is supported.
Starred by 188 users
Forked by 14 users
Languages   Python
🌐
GeeksforGeeks
geeksforgeeks.org › python › introduction-to-python-tabulate-library
Introduction to Python Tabulate Library - GeeksforGeeks
July 23, 2025 - tabulate supports various formats, ... formats include: ... rst: Generates tables compatible with reStructuredText (reST), which is widely used for technical documentation, including Python's documentation....
🌐
Analytics Vidhya
analyticsvidhya.com › home › comprehensive guide to python’s tabulate library
Comprehensive Guide to Python's Tabulate Library - Analytics Vidhya
May 29, 2025 - Learn everything about python's Tabulate category, how to use, what are the different features, applications, examples and more.
🌐
AskPython
askpython.com › home › python tabulate module: how to easily create tables in python?
Python tabulate module: How to Easily Create Tables in Python? - AskPython
June 8, 2023 - Python tabulate makes creating and formatting tables easy and efficient. Start by importing the module. You can then create a table by storing your data in a nested list and passing it to the tabulate function.
🌐
Readthedocs
pyhdust.readthedocs.io › tabulate.html
tabulate: auxiliary module to tablature matrix — Python tools for the BeACoN group Stable documentation
tabulate tries to detect column types automatically, and aligns the values properly. By default it aligns decimal points of the numbers (or flushes integer numbers to the right), and flushes everything else to the left.
🌐
Analytics India Magazine
analyticsindiamag.com › deep-tech › beginners-guide-to-tabulate-python-tool-for-creating-nicely-formatted-tables
Tabulate python Examples to Create Formatted Tables
December 30, 2024 - Nicely formatted tables not only ... clearly with its heading and value. Tabulate is an open-source python package/module which is used to print tabular data in nicely formatted tables....
Find elsewhere
🌐
Snyk
snyk.io › advisor › tabulate › functions › tabulate.tabulate
How to use the tabulate.tabulate function in tabulate | Snyk
rows = [] header = ['Operation', 'Response\nCount', 'RespSize\nBytes', 'MaxObjCnt\nRequest', 'operation\nCount', 'Total execution\ntime (hh:mm:ss)', 'inst/sec', 'runid'] for response_size in response_sizes: for response_count in response_counts: # run_single_test(conn, response_count, response_size, pull_sizes) rows.extend(run_single_test(conn, runid, response_count, response_size, pull_sizes)) print(' Response results for pywbem version %s runid %s execution time %s' % (__version__, runid, format_timedelta(test_timer.elapsed_time()))) table = tabulate(rows, headers=header, tablefmt="simple") print(table) if verbose: rows = [] for stat in STATS_LIST: rows.append(stat) headers = ['Operation', 'Max Object\ncount', 'Op\nCount', 'inst count', 'Operation\nTime'] table = tabulate(rows, headers=headers) print(table) astanin / python-tabulate / test / test_regression.py View on Github ·
🌐
Hanspeterschaub
hanspeterschaub.info › basilisk › Documentation › utilities › tabulate.html
tabulate — Basilisk 2.4.0 documentation
The first required argument (tabular_data) can be a list-of-lists (or another iterable of iterables), a list of named tuples, a dictionary of iterables, an iterable of dictionaries, a two-dimensional NumPy array, NumPy record array, or a Pandas’ dataframe.
🌐
Medium
medium.com › @HeCanThink › tabulate-your-go-to-solution-for-stylish-tables-in-python-35ede5145e28
Tabulate: Your Go-To Solution for Stylish Tables in Python 👉 | by Manoj Das | Medium
August 19, 2023 - Multiple Output Formats: Tabulate supports multiple output formats, such as plain text, simple, grid, pipe, html, and LaTeX. This makes it suitable for different use cases, whether you’re printing to the console, generating HTML reports, or creating LaTeX documents.
Top answer
1 of 16
1041

There are some light and useful python packages for this purpose:

1. tabulate

https://pypi.python.org/pypi/tabulate

from tabulate import tabulate
print(tabulate([['Alice', 24], ['Bob', 19]], headers=['Name', 'Age']))
Name      Age
------  -----
Alice      24
Bob        19

tabulate has many options to specify headers and table format.

print(tabulate(
    [['Alice', 24], ['Bob', 19]],
    headers=['Name', 'Age'],
    tablefmt='orgtbl'))
| Name   |   Age |
|--------+-------|
| Alice  |    24 |
| Bob    |    19 |

2. PrettyTable

https://pypi.python.org/pypi/PrettyTable

from prettytable import PrettyTable
t = PrettyTable(['Name', 'Age'])
t.add_row(['Alice', 24])
t.add_row(['Bob', 19])
print(t)
+-------+-----+
|  Name | Age |
+-------+-----+
| Alice |  24 |
|  Bob  |  19 |
+-------+-----+

PrettyTable has options to read data from csv, html, sql database. Also you are able to select subset of data, sort table and change table styles.

3. texttable

https://pypi.python.org/pypi/texttable

from texttable import Texttable
t = Texttable()
t.add_rows([['Name', 'Age'], ['Alice', 24], ['Bob', 19]])
print(t.draw())
+-------+-----+
| Name  | Age |
+=======+=====+
| Alice | 24  |
+-------+-----+
| Bob   | 19  |
+-------+-----+

with texttable you can control horizontal/vertical align, border style and data types.

4. termtables

https://github.com/nschloe/termtables

import termtables as tt

string = tt.to_string(
    [["Alice", 24], ["Bob", 19]],
    header=["Name", "Age"],
    style=tt.styles.ascii_thin_double,
    # alignment="ll",
    # padding=(0, 1),
)
print(string)
+-------+-----+
| Name  | Age |
+=======+=====+
| Alice | 24  |
+-------+-----+
| Bob   | 19  |
+-------+-----+

with texttable you can control horizontal/vertical align, border style and data types.

Other options

  • terminaltables - Easily draw tables in terminal/console applications from a list of lists of strings. Supports multi-line rows.
  • asciitable can read and write a wide range of ASCII table formats via built-in Extension Reader Classes.
2 of 16
324

Some ad-hoc code:

row_format ="{:>15}" * (len(teams_list) + 1)
print(row_format.format("", *teams_list))
for team, row in zip(teams_list, data):
    print(row_format.format(team, *row))

This relies on str.format() and the Format Specification Mini-Language.

🌐
Readthedocs
pyhdust.readthedocs.io › _modules › pyhdust › tabulate.html
pyhdust.tabulate — Python tools for the BeACoN group Stable documentation
======== strings numbers ========= ========= spam 41.9999 eggs 451 ========= ========= >>> print(tabulate([["spam", 41.9999], ["eggs", "451.0"]], tablefmt="rst")) ==== ======== spam 41.9999 eggs 451 ==== ======== "mediawiki" produces a table markup used in Wikipedia and on other MediaWiki-based sites: >>> print(tabulate([["strings", "numbers"], ["spam", 41.9999], ["eggs", "451.0"]], headers="firstrow", tablefmt="mediawiki")) {| class="wikitable" style="text-align: left;" |+ <!-- caption --> |- ! strings !! align="right"| numbers |- | spam || align="right"| 41.9999 |- | eggs || align="right"| 4
🌐
GitHub
github.com › thruston › python-tabulate › blob › master › README.md
python-tabulate/README.md at master · thruston/python-tabulate
This verb provides an equivalent of the normal Python3 list method pop for the table. By default pop removes the last row, but you can use it to remove any row with the appropriate integer argument. For the purposes of pop the rows are zero indexed, so pop 0 will remove the top row, and the usual convention of negative indexes applies, so pop -1 will remove the last. Indexes that are too large are just ignored. Obviously if you are using tabulate from an editor you could just delete the row directly instead of use this command, but it is handy in certain idioms.
Author   thruston
🌐
GitHub
github.com › thruston › python-tabulate
GitHub - thruston/python-tabulate: A neat-text-table filter · GitHub
This verb provides an equivalent of the normal Python3 list method pop for the table. By default pop removes the last row, but you can use it to remove any row with the appropriate integer argument. For the purposes of pop the rows are zero indexed, so pop 0 will remove the top row, and the usual convention of negative indexes applies, so pop -1 will remove the last. Indexes that are too large are just ignored. Obviously if you are using tabulate from an editor you could just delete the row directly instead of use this command, but it is handy in certain idioms.
Author   thruston
🌐
LinkedIn
linkedin.com › pulse › effortless-data-tabulation-python-tabulate-library-360-digitmg
Effortless Data Tabulation in Python with Tabulate Library
September 8, 2023 - This means you can rely on consistent updates, bug fixes, and improvements to the library over time. ... The library comes with comprehensive documentation, including usage examples, explanations of formatting options, and implementation details.