Skip to content
GPLWP Guides

How to create tables and charts in WordPress

Analytics Time About 30 minutes for a simple table and chart 6 steps Updated 11 Sep 2026

ANALYTICS
The short answer

WordPress includes a Table block for simple tabular data, but it does not provide a general chart builder in core. Use a Custom HTML block with an external chart embed or JavaScript for a one-off chart; use a plugin when the data needs imports, filtering, searching or regular updates.

The route
  1. 01Prepare the data
  2. 02Add a Table block
  3. 03Format and check the table
  4. 04Choose a manual chart route
  5. 05Add an accessible explanation
  6. 06Use the fast way

What you need

  • A WordPress site with permission to edit posts or pages
  • The data in a clean spreadsheet or CSV file
  • A chart embed, JavaScript library, or table-and-chart plugin for the chart

Prepare the data

Decide what the table or chart needs to show before opening WordPress. Put column headings in the first row, use one value per cell, keep dates and units consistent, and remove empty rows or decorative formatting from the source spreadsheet.

Use a table for exact values that visitors may need to compare. Use a chart for a small number of clear trends or proportions. Do not make a chart carry information that is missing from the table or its text alternative.

Add a Table block

Edit the post or page, select the + button, search for Table, and choose the number of columns and rows. Paste or type the data into the cells, then add a header section, caption, and footer when they help explain the information. WordPress documents the Table block as the core way to create structured rows and columns.

For a small, rarely changed table, this manual route is usually enough. It is saved as static post content, so updating a large dataset means editing the cells again rather than refreshing a connected spreadsheet.

Format and check the table

Select the table and use the block settings to adjust fixed-width cells, header and footer sections, alignment, colours, typography, spacing, borders and the default or striped style. Add a caption when the table needs context, and keep headings descriptive rather than relying on colour alone.

Preview the page on a narrow screen. Wide tables may become difficult to read or force horizontal scrolling, and the final appearance depends partly on the active theme. Check the published page, not only the editor preview.

Choose a manual chart route

WordPress core gives you a Table block but not a general-purpose chart block. For one chart, create it in a spreadsheet or chart service and paste its supported embed into a Custom HTML block. Alternatively, a developer can render a canvas chart with a JavaScript library such as Chart.js by supplying labels, datasets and a chart type.

This route is fine for a stable, low-maintenance chart, but it is not a good editorial workflow for changing data. Custom HTML JavaScript can be removed when the user lacks the unfiltered_html capability, and security or multisite rules can also strip script tags. If the chart disappears after saving, check permissions and sanitisation before changing the chart code.

Add an accessible explanation

Give the chart a descriptive title and explain its main conclusion in nearby text. Keep the underlying figures in a table or provide a text summary so visitors are not dependent on canvas graphics, colour differences or hover tooltips. Include units, date ranges and the data source where they affect interpretation.

Check that labels are readable on mobile, the chart is not clipped by its container, and the numbers in the chart agree with the table. A chart that loads in the editor but fails on the published page usually has an embed, script-loading, caching or permission problem.

Use the fast way

For searchable data presentations, install and activate wpDataTables, then create a table from entered data or an Excel, CSV or Google Sheets source. Configure the columns, responsive behaviour, sorting, filtering and search, insert the table into the required post or page, and create a chart from the table data when needed.

This is the practical choice when the dataset is large, changes regularly, must be imported from a spreadsheet, or needs interactive tables and charts rather than a static block. For one small table and one unchanging chart, the manual route is still simpler and avoids adding a plugin.

The fast route

Let wpDataTables do it

Interactive responsive tables with charts and spreadsheet imports; choose it for searchable data presentations rather than static tables.

Get wpDataTables

Sources

  1. wordpress.org /documentation/article/table-block/?utm_source=openai
  2. developer.wordpress.org /block-editor/reference-guides/core-blocks/core-blocks-text/…
  3. developer.wordpress.org /block-editor/reference-guides/core-blocks/?utm_source=opena…
  4. wordpress.org /documentation/article/custom-html/?utm_source=openai

Questions

Can WordPress create tables without a plugin?
Yes. WordPress includes a Table block for creating rows and columns directly in the editor, including headers, captions, styling and cell editing. It is suitable for small static datasets. The drawback is that the table is saved in the post content, so large or frequently changing data must be maintained manually rather than refreshed from a spreadsheet.
Can WordPress create charts without a plugin?
Yes, but not through a dedicated core chart block. You can embed a chart made elsewhere or use a Custom HTML block with a JavaScript chart library. This requires more setup and can fail when WordPress sanitises scripts or the user lacks the required capability. For editorial users who need to update data regularly, a chart plugin is usually easier to maintain.
Why does my table look wrong on mobile?
Tables often become cramped when they contain too many columns or long labels. Preview the published page on a phone, shorten headings where possible, remove unnecessary columns, and check the theme’s table styling. WordPress’s Table block has responsive behaviour documented for mobile, but the final layout still depends on the theme and the width of the data.
Why did my chart disappear after I saved the page?
The chart code may have been stripped from the Custom HTML block because the editing account lacks the unfiltered_html capability, or because a multisite or security setting sanitises script tags. Check the saved block first, then review user permissions, multisite rules, security plugins and cache settings. A plugin-based chart avoids much of this manual script handling.
Should I use a table, a chart, or both?
Use a table when visitors need exact figures, detailed comparisons or accessible text. Use a chart when the main point is a trend, ranking or proportion that can be understood quickly. Use both when the chart provides the overview and the table provides the supporting values. Keep the date range, units and data source clear in either presentation.