Skip to content

HTML Table Generator

Embed

Paste this where you want HTML Table Generator on your site. Adjust the height to fit.

<iframe src="https://www.browserutils.dev/embed/html-table-generator/" width="100%" height="500" frameborder="0" loading="lazy" title="HTML Table Generator"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://www.browserutils.dev/tools/html-table-generator/">HTML Table Generator</a> by BrowserUtils</p>

Generate HTML tables with configurable rows and columns.Runs in this tab.

<table>
  <thead>
    <tr>
      <th>Header 1</th>
      <th>Header 2</th>
      <th>Header 3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <td></td>
      <td></td>
      <td></td>
    </tr>
  </tbody>
</table>
Header 1 Header 2 Header 3

How to use HTML Table Generator

  1. Set Rows and Columns. The page opens at 3 and 3. Header Row is on, which adds a header row above those body rows.
  2. Type in the cells. An empty header cell is written as Header 1, Header 2, and so on. An empty body cell is an empty td.
  3. Copy the Generated HTML. Turn Header Row off if the first row should be a body row.

The HTML this grid emits

The page opens at 3 columns, 3 body rows, and Header Row on. An empty header cell is written as Header 1, Header 2, and so on. An empty body cell is <td></td>.

Set Rows to 1, leave Header Row on, and fill the header with Name, Qty, Price and the body row with Widgets, 4, 12.50:

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Qty</th>
      <th>Price</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Widgets</td>
      <td>4</td>
      <td>12.50</td>
    </tr>
  </tbody>
</table>

A cell containing a < b & c is escaped:

<td>a &lt; b &amp; c</td>

A double quote in a cell becomes &quot;.

Turn Header Row off and the first row is a body row. There is no thead:

<table>
  <tbody>
    <tr>
      <td>Name</td>
      <td>Qty</td>
      <td>Price</td>
    </tr>
  </tbody>
</table>

You type or paste into the grid, and the page emits that table. It does not import a spreadsheet, and it does not read an existing HTML page back into the cells. The markup has no class, border, caption, scope, colspan, or tfoot.

Next step

Questions

How do I create an HTML table?
Set Rows and Columns, leave Header Row on, and type in the grid. A header row of Name, Qty, Price and a body row of Widgets, 4, 12.50 (with Rows set to 1) produces a table with thead th cells and one tbody tr. Indentation is two spaces.
Can this turn a table into HTML, or HTML into a table?
You type or paste into the grid, and the page emits a table element. It does not import an Excel or CSV file, and it does not parse an existing HTML page into the grid. There is no class, border, caption, scope, colspan, or tfoot.
Does the generator escape cell text?
Yes. A cell that contains a < b & c is written as a &lt; b &amp; c. Quotes become &quot;. With Header Row off, that row is a td inside tbody and there is no thead.

More in Code Generators

All 26 code generators