Appearance
Create Your First Table
A Default table is a table whose rows you type, paste or import yourself. This guide walks through building one from start to finish: create the table, add columns and rows, style it, and put it on a page. For a shorter version, see the guided setup and quick start.
Create the table
In your WordPress admin, click Ninja Tables, then Create Table in the top bar. You can also click New table on the Tables list.
On the Create a table screen, click Default table under Start from scratch.
In the panel that opens, enter a Table name. It's required.
Optionally add a Description. The editor lets you add bold and italic text, lists, links and media.
Check the engine line. It is set to DataTables (recommended), which suits tables of any size. Click Change and pick FooTable if you want the lighter classic engine or the Semantic UI / Bootstrap style library. The engine of a Default table can't be changed later; see choose an engine and Create a FooTable.
Click Create table.
The table opens in the editor on the Table Rows tab.
The other tiles on the Create a table screen build different kinds of tables, such as tables from a file, WooCommerce products or a SQL query. See All table types at a glance. For a table built from a database query, see Custom SQL table.
Add columns
A new table has no columns, so the tab shows Add your columns, with one line per column:
- Type a Column name on each line, and pick its Type and Responsive visibility.
- Press Enter or click Add another for a new line. To fill several lines at once, paste a list of names (one per line) or a header row from a spreadsheet.
- Click Create column. With several lines, the button reads Create 3 columns, with the number you've named.
You can change these, and every other column setting, later from the gear on the column.
To set everything for one column as you create it, click All options for one column. On the Basic tab, fill in:
- Column name: the header visitors see.
- Column key: filled in from the name. Use English letters, numbers and
_only. It's used by shortcodes, imports and filters, and it can't change later. - Type: Single line text field, Text area, HTML field, Numeric value or Date field. Select field, Image/File/Lightbox and Button/Link also appear in the list, but they need Pro to work. On the free version a note says so. A Select column works as plain text, and a new Image/File/Lightbox or Button/Link column is saved as Single line text.
- Responsive visibility: whether the column is always shown, or hidden on some screen sizes.
Then click Add column.
Repeat for each column. To edit a column later, open the menu on its header in Table Rows and click Column settings. The same menu lets you add a column to the left or right, or delete the column. To move a column, drag the grip icon (Drag to reorder) at the left of its header. To sort the grid for a moment, click a column name; this view is never saved.
Add rows
Click Add data in the toolbar. A panel opens with one field per column.
- Fill in the fields.
- Tick Add another after this if you want to add more rows straight away.
- Click Add row.
The toolbar above the grid also has:
- Search rows: find rows by any value.
- Sort manually (Pro): drag rows into the order visitors see. See Sort rows manually.
- Compact View: show more rows on screen.
- Import / Export: add rows from a CSV file, or export the table. See Import rows into an existing table.
For everything you can do in the grid, see Working in Table Rows.
Edit, duplicate and delete rows
Each row has its own actions at the end of the row:
- Edit row opens the row in the side panel, where you can also change its Created date. Use Previous row and Next row to move through the table without closing it.
- Row actions › Insert row below (Pro), Duplicate row or Delete row.
- Row settings (palette icon) sets the row's background and text colors (Pro). Cells have their own Cell settings. See Row and cell colors.
To delete several rows at once, tick them and click Delete in the toolbar.
Fine-tune your columns
The column dialog has three more tabs:
- Advanced: text alignment, Click to copy, and (Pro) column width, extra CSS classes, background and text colors, Sortable, Searchable and HTML header content. See Advanced column settings.
- Conditions (Pro): style a cell, row or column when its value matches a rule, such as "greater than 100". See Conditional formatting.
- Transform (Pro): change how a value is shown, for example turning plain text into a link, or calculating it with an Excel formula. See Transform value.
Click Save column after changing a column.
Style the table in Table Design
Click the Table Design tab. On the left is a live preview of your table, which you can switch between Desktop, Tablet and Mobile. The side panel has three tabs.
- Styling: Style (the style library, Semantic UI, Bootstrap 4 or Bootstrap 3 on FooTable, plus rows, borders and layout switches), Typography (font family and size) and Title & Header (show the table title, description and header row).
- Features: Search, Sorting and Pagination (what visitors can search, the default order and how many rows show per page), Mobile (responsive breakpoint and stackable table), Sticky Header & Column (Pro), Export & Print (Pro) and Row Details (the row details popup).
- Colors: pick a preset color scheme, or set your own colors (Pro).
Click Save at the top of the editor to keep your changes. See the Table Design overview for every option. To change the starting look of every new table, use Settings › Global Appearance.
Check Table Configuration
The Table Configuration tab controls how the table loads: its engine, whether rows load with Ajax or are built into the page (Legacy, Pro), and caching. The defaults suit most tables: new tables use Ajax on the free version and Legacy when Pro is active. See Engine, rendering and caching.
Preview and embed the table
- Click Preview at the top of the editor to open the table on its own page.
- Click the shortcode at the top of the editor, for example
[ninja_tables id="123"], to copy it. The same shortcode is in the Shortcode column of the Tables list.
Paste the shortcode into any post or page, or add the Ninja Tables block in the block editor and search for your table by name.
WARNING
The design options in the block's sidebar are saved to the table itself. Changing them changes the table on every page where it's shown, not just this one.
See Embed a table for the block editor, the classic editor and page builders.
Next steps
- Duplicate a table to reuse its setup.
- Add custom filters (Pro) above the table.
- Let users edit the table from the page (Pro).