Skip to content

HTML table generator

Build the table in a grid and copy semantic, escaped <table> markup with a caption, <thead> and scoped headers, and no inline clutter.

The elements of a good HTML table

  • <caption>: the table's title, read first by screen readers.
  • <thead> / <tbody>: separate the header from the data, so browsers can repeat headers when printing.
  • <th scope="col">: ties each data cell to its column header (WAI tables tutorial, W3C).
  • Alignment is written as style="text-align:…" only where you changed it.

Convert instead of typing

Turn existing data into a table with CSV to HTML table or JSON to HTML table. To scrape a table off a web page, use HTML table to CSV.

Questions people ask

What makes an HTML table accessible?

Put header cells in <th> with scope="col" (or scope="row" for row headers), group them in <thead>, and add a <caption> that says what the table shows. Screen readers use these to announce each cell with its header. The generator writes all three.

Should I use tables for page layout?

No. Use CSS grid or flexbox for layout. Tables are for tabular data: things with rows and columns that you would put in a spreadsheet. That is exactly what this generator is for.

How do I style the table?

Give it a class (for example data-table) in the options and target it in your CSS: .data-table { border-collapse: collapse } .data-table td, .data-table th { padding: .5rem; border-bottom: 1px solid #ddd }.

Is the markup safe to paste into a CMS?

Yes. Cell text is HTML-escaped (<, >, & and quotes), so content like “a < b” cannot break the page or inject script.