HTML Table Generator

Type or paste your data into a grid and get clean, accessible HTML table code with a caption, header cells, and optional CSS for borders and striped rows.

Updated
Runs in your browser. Your data is not uploaded.
Cells
Paste from a spreadsheet or CSV
Preview
HTML
CSS

How to use the HTML Table Generator

  1. Type into the Cells grid, add rows and columns, or open Paste from a spreadsheet or CSV and paste your data. Pasting several cells into one grid cell also fills the grid.
  2. Set the Caption, and tick First row is a header, First column is a header, and the styles you want.
  3. Check the Preview, then copy the HTML and, if you picked styles, the CSS.

How it works

  • A header row becomes <thead> with <th scope="col">; a header column becomes <th scope="row">. Screen readers use these to announce which header a cell belongs to.
  • The caption goes in <caption>, the table's accessible name.
  • Pasted text is split by tabs when it comes from a spreadsheet, and read as CSV (with quoted fields) otherwise.
  • Every cell is HTML-escaped, so < and & in your data show as text.
  • Rows shorter than the widest row are padded with empty cells.

Examples

<table class="table">
  <caption>Plan prices</caption>
  <thead>
    <tr><th scope="col">Plan</th><th scope="col">Price</th><th scope="col">Users</th></tr>
  </thead>
  <tbody>
    <tr><td>Starter</td><td>$9</td><td>1</td></tr>
    ...
  </tbody>
</table>

Limitations

  • Merged cells (colspan, rowspan) are not supported.
  • Cell text is plain text; links and formatting inside cells need editing afterwards.
  • Wide tables need a scroll wrapper on small screens, for example <div style="overflow-x:auto">.

Frequently asked questions

How do I convert Excel data to an HTML table?

Select the cells in Excel or Google Sheets, copy, and paste into the first grid cell or the paste box. The columns come across as separate cells.

What makes an HTML table accessible?

A caption, header cells marked with <th> and a scope, and using tables only for tabular data, not for page layout.

Do I need the CSS?

No. Without it, the table uses your site's styles. The CSS is there for pages that have no table styles yet.

Is my data uploaded?

No. The table is built in your browser.

Often used together with the HTML Table Generator.