2026年11月12日
2026年11月12日
TablePress Guide: Create, Embed, Sort, Import CSV and Style Tables
This article is a localized edition of the Japanese original. Read the Japanese original
TablePress is a plugin for creating tables in the WordPress admin and embedding them in posts and pages. Table data is stored separately from your posts, so you can show the same table on several pages or update just the table. It also includes features that let site visitors sort and search tables (using a JavaScript library called DataTables).
The steps and screen names in this article were checked in November 2026 with TablePress 3.4.1 on WordPress 7.1. Some items on the table edit screen (such as the Table Options entries) have no Japanese translation and appear in English even in the Japanese admin. This article uses the labels exactly as shown on screen.
Install the plugin
Go to Plugins → Add New Plugin, search for "TablePress", install it and activate it. With WP-CLI:
wp plugin install tablepress --activate
After activation, a "TablePress" menu appears in the admin. Its submenus include "All Tables", "Add New Table", "Import a Table", "Export a Table" and "Plugin Options".
Create a table
- Open TablePress → Add New Table.
- Enter a "Table Name" (for example, Price list), set the "Number of Rows" and "Number of Columns", and click "Add Table". The description is optional. You can add or remove rows and columns later on the edit screen.
- In "Table Content" on the edit screen, type into the cells as you would in a spreadsheet.
- Click "Save Changes" at the top of the screen. "Preview" shows how it will look on the site.
For a 3-row, 3-column price list, you might enter the following (A to C are the column names, and the first row becomes the header).
| A | B | C |
|---|---|---|
| Plan | Monthly | Includes |
| Standard | 980 yen | Basic features |
| Pro | 1,980 yen | All features |
Cells can also contain HTML. The edit screen toolbar lets you insert links and images and merge cells. However, if a table has merged cells in its body rows (anything other than the header), you cannot use the sorting, search and other features described next.
Table Options
The main items under "Table Options" on the edit screen:
| Item | What it does | Default for new tables |
|---|---|---|
| Table Header | How many rows at the top are header rows (th) | 1 row |
| Table Footer | How many rows at the bottom are footer rows | 0 rows |
| Alternating Row Colors | Alternates the background color of consecutive rows | On |
| Row Hover Highlighting | Changes the background of the row under the mouse | On |
| Print Table Name / Description | Shows the table name or description above or below the table | Off |
| Extra CSS Classes | Adds CSS classes to the table | Empty |
Embed a table in a post or page
In the block editor
- On the post edit screen, add the "TablePress table" block.
- In the Settings sidebar on the right, choose the table to display.
With a shortcode
The "Table Information" section of the edit screen shows the table's shortcode (with a button to copy it). For the table with ID 1 it looks like this. In the block editor, paste it into a Shortcode block; in the Classic Editor, paste it into the content.
[table id=1 /]
Shortcodes also accept parameters that override a table's settings in that one place.
[table id=1 use_datatables=false /]
[table id=1 print_name=true /]
[table id=1 hide_columns=3 /]
The first line shows the table without sorting, search and the other features, the second shows the table name as a heading, and the third hides the third column.
Note that the table ID (the id in the shortcode) is a different number from the WordPress post ID.
Set up sorting, search and pagination
Choose the visitor features under "Table Features for Site Visitors" on the edit screen. For newly created tables, all of them are on from the start.
| Item | What it does |
|---|---|
| Enable Visitor Features | Turns all the features in this section on or off |
| Sorting | Sort by clicking a column heading |
| Search/Filtering | A search box that shows only rows containing the entered term |
| Pagination | Paging. Set rows per page with the number in "Show 10 rows per page." |
| Pagination Length Change | Lets visitors change the number of rows per page |
| Info | Shows "x to y of z entries" |
| Horizontal Scrolling | Scrolls tables with many columns horizontally |
These features are only available when Table Header in "Table Options" is set to at least one row. The wording of the search box and pagination follows the site language (for example, it appears in Japanese on a Japanese site).
For a small table such as a short price list, a search box and pagination just get in the way. Turn off "Enable Visitor Features" or keep only the features you need.
Fine-tune with Custom Commands
"Custom Commands" in the same section accepts DataTables initialization options. TablePress wraps the content in { and } before passing it to DataTables, so do not write the outer braces.
For example, to sort by the second column in ascending order when the table first loads (columns are counted from 0):
"order": [[1, "asc"]]
Separate multiple options with commas.
"order": [[1, "asc"]], "pageLength": 25
Anything you write here takes priority over the settings in the table above. A syntax mistake stops the table features from working, so check with "Preview" after saving.
Import from CSV or Excel
- Open TablePress → Import a Table.
- Under "Import Source", choose File Upload, URL, Manual Input (paste) or another source, and specify the file.
- Choose how to import: "Add as new table", "Replace existing table" or "Append rows to existing table", then import.
According to the readme, import and export support Excel, CSV, HTML and JSON. You can also import several tables at once by putting them in a ZIP file.
Watch the character encoding of CSV files
When Excel saves a table containing Japanese text in plain "CSV" format, the file may be encoded in Shift_JIS. On import, TablePress detects the encoding only among UTF-8, ISO-8859-1 and ASCII and converts from that, so a Shift_JIS CSV comes out garbled. Import in one of these ways:
- In Excel, save as "CSV UTF-8 (Comma delimited)"
- Skip CSV and import the .xlsx file as is
Where table data is stored
TablePress stores each table as a post of the post type tablepress_table. The table content goes into the post content (post_content) as JSON, and the table options into the post meta _tablepress_table_options. The mapping between table IDs and post IDs is in the option tablepress_tables.
# List tables (the ID is the post ID)
wp post list --post_type=tablepress_table --fields=ID,post_title
# Table ID to post ID mapping ("table_post":{"1":5} means table 1 is post 5)
wp option get tablepress_tables
For backups or moving tables to another site, you can export them in JSON format with "Export a Table".
Change the look with CSS
Write your CSS under "Custom CSS" in TablePress → Plugin Options, check "Load this “Custom CSS” code to change the table styling:" and save. CSS in the theme's "Additional CSS" also works.
TablePress 3's default CSS sets colors and spacing with CSS variables. Overriding the variables lets you change colors with very little code.
/* All tables */
.tablepress {
--head-bg-color: #1d2327;
--head-text-color: #fff;
--even-bg-color: #f6f7f7;
--hover-bg-color: #e8f0fe;
--border-color: #c3c4c7;
}
/* Only the table with ID 1: make the first column bold */
.tablepress-id-1 tbody .column-1 {
font-weight: bold;
}
Available variables include --text-color, --head-bg-color, --head-text-color, --odd-bg-color, --even-bg-color, --hover-bg-color, --border-color and --padding. Each table gets a class tablepress-id-<table ID>, cells get classes like column-1 and rows get classes like row-1, so you can target a specific table, column or row.
Things to keep in mind
- When a page contains a table that uses sorting, search or other features, the DataTables JavaScript is loaded. In TablePress 3.4 it also depends on jQuery. For tables that do not need the features, turning off "Enable Visitor Features" keeps it from loading.
- Even with pagination, every row of the table is output in the HTML and the browser switches what is shown. Large tables make the page heavy, so consider splitting them.
- Tables with many columns overflow the screen on smartphones. Turn on "Horizontal Scrolling" or reduce the number of columns.
Questions about WordPress? The publisher of this site is based in Japan and replies in Japanese. Contact (Japanese)