Table Editor

HTML Table Generator

Build the table in the grid, with header rows, merged cells and borders, then copy the HTML into your web page.

How to create your table

  1. Type or paste your data in the grid. Turn on Headers › Header row so the first row becomes the header.
  2. Merge cells from the Table menu, and set borders and format cells from the Format menu.
  3. Choose a styling option in the output panel menu (⋮), then copy the HTML.

Example output

<table>
  <thead>
    <tr>
      <th style="text-align: left">Item</th>
      <th style="text-align: right">Qty</th>
      <th style="text-align: right">Price</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Widget</td>
      <td style="text-align: right">4</td>
      <td style="text-align: right">3.00</td>
    </tr>
    <tr>
      <td>Gadget</td>
      <td style="text-align: right">12</td>
      <td style="text-align: right">5.50</td>
    </tr>
  </tbody>
</table>

HTML table structure

An HTML table is a <table> element with one <tr> element per row. Header cells are <th> and data cells are <td>. The header rows can be grouped in <thead> and the other rows in <tbody>, and a <caption> gives the table a title that screen readers announce.

The generator puts your header rows in <thead> as <th> cells and the other rows in <tbody>. Cells in a header column become <th scope="row">. A caption set with Table › Table caption is written as <caption>.

<table>
  <caption>Stock</caption>
  <thead>
    <tr>
      <th>Item</th>
      <th>Qty</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Widget</td>
      <td>4</td>
    </tr>
  </tbody>
</table>

Merged cells: colspan and rowspan

colspan="2" makes a cell two columns wide and rowspan="2" makes it two rows tall. The cells it covers are left out of the HTML, so a row under a rowspan cell has one cell fewer, and the browser moves the rest of the row over.

When you merge cells in the editor, the generator writes colspan and rowspan on the merged cell and leaves out the cells it covers. A merged cell that runs from the header rows into the body cannot sit inside <thead>, so then the rows are not split into <thead> and <tbody>; the header cells are still <th>.

<tr>
  <td rowspan="2">Q1</td>
  <td>January</td>
</tr>
<tr>
  <td>February</td>
</tr>

Styling options

Choose Styling in the output panel menu (⋮). Inline styles writes alignment and borders as style attributes, such as style="text-align: right", and gives a table with borders border-collapse: collapse.

CSS classes writes a <style> block before the table, with classes such as .table-align-right and .table-border-top. The class prefix comes from the table caption, or is table when there is none. Tailwind CSS writes utility classes instead: text-right, text-center, border-t, border-b and so on. No styling writes the table without alignment or borders.

Bold, italic, underlined and struck-through text use <strong>, <em>, <u> and <s> with every option.

Wide tables on small screens

A table wider than the screen makes a phone scroll the whole page sideways. The generator writes no element around the <table>, so if your page needs it, wrap the table in an element that scrolls, for example a <div> with overflow-x: auto. The table then scrolls inside the box and the rest of the page keeps its width.

<div style="overflow-x: auto">
  <table>
    ...
  </table>
</div>

Converting Excel, Google Sheets or CSV to HTML

Copy the cells in Excel or Google Sheets and paste them into the grid, or open a .xlsx, .ods or .csv file with File › Import. When the first row of an Excel or OpenDocument sheet is bold, it becomes the header row; otherwise use Row › Set first row as header.

You can also paste an existing HTML table into File › Import, or open an .html file, to change it. The importer reads <thead>, <th>, colspan, rowspan, the caption, alignment, borders, and bold and italic text. If the table has no merged cells, it can also be copied as Markdown.

What the editor can do

  • Merge and split cells
  • Paste cells from Excel, Google Sheets or an HTML table
  • Import CSV, TSV, Excel (.xlsx), OpenDocument (.ods), Markdown, HTML, LaTeX, Typst, JSON, MediaWiki and plain text tables
  • Copy the table as one of 14 text formats, or download it as an Excel, OpenDocument or Word (.docx) file
  • Header rows and columns, borders, and bold, italic and alignment per cell
  • Number formats for numbers, percentages and currencies
  • Checkboxes, and one link per cell. Links stay links in Markdown, HTML, LaTeX, Typst, Excel, Word and the other formats that have them
  • Sort, transpose, fill down or right, and find and replace with regular expressions
  • Undo and redo, keyboard shortcuts and a command palette (Alt+Q)
  • Save tables in the browser, reopen recent tables and share a table as a link
  • Also available as a Windows app

Table Editor for Windows

The same editor as a Windows app, with what a browser tab can't do.

  • Tabs. Keep several tables open at once. Tabs with unsaved changes come back when you start the app again.
  • Your own files. Open Excel, CSV, Markdown, LaTeX and other files directly, also from Windows Explorer, and save back to the same file.
  • Offline, without ads. Works without an internet connection. No ads, no analytics, and nothing leaves your computer.

A one-time purchase in the Microsoft Store.

Get it from MicrosoftGet it from Microsoft

Frequently asked questions

How do I convert an Excel table to HTML?
Copy the cells in Excel, click the first cell of the grid and paste with Ctrl+V, or open the .xlsx file with File › Import, which keeps merged cells. Choose a styling option in the output panel menu (⋮) and copy the HTML.
Does it output <thead> and <tbody>?
Header rows go in <thead> as <th> cells, and the other rows go in <tbody>. A table without a header row is written as plain <tr> rows.
How is the table styled?
Choose Inline styles, Tailwind CSS, CSS classes or No styling in the output panel menu. Inline styles put alignment and borders in style attributes. CSS classes adds a <style> block with class names you can change. No styling writes only the table structure.
Are merged cells, borders and text formatting kept?
Merged cells use colspan and rowspan. Bold and italic text use <strong> and <em>. Borders and alignment follow the styling option you chose, and are left out with No styling.
What happens to links and checkboxes?
A link set with Format › Link… is written as <a href="...">, and so is a cell that holds only a web address. When you paste or import HTML, a link that covers the whole cell becomes the cell's link; a link inside other text is kept as text. Only http and https links are read. A checkbox (Format › Number format › Checkbox) is written as ✓ when it is checked and as an empty cell when it is not. The Checkboxes as setting in the output panel menu (⋮) changes that to Yes and No, or true and false.
How do I get the table into Word?
Choose File › Export and Word (.docx) to download a Word document with the table. It keeps merged cells, borders, header rows (repeated on each page) and column widths, and the caption becomes a numbered Word caption. To paste into a document you already have open, use Edit › Copy table instead.

Sources and further reading

About Table Editor · Changelog

Loading the editor…