Skip to content
Toolspire

Developer Tools

HTML Table Generator

HTML Table Generator is part of Toolspire and is ready as soon as this page loads. The first line becomes <th> cells. Later lines become <td> cells. A tab separator wins over commas when a line contains a tab.

Runs in this tabFreeNo account

On this page

What you can do here

Header from row one

You do not mark the header with a special character. The first line is <thead>.

Tabs beat commas

A TSV paste still works if a cell happens to contain a comma, as long as the columns are tabbed.

Escaped cells

The output is text markup. Angle brackets in the source become entities in the HTML.

The sequence

How to use the HTML Table Generator

  1. 1

    Put column names on the first line

    Name,Score is a header. If your paste has no header, add one or the first data row will be labelled as a header.

  2. 2

    Use one row per line

    Blank lines are dropped. A trailing comma creates an empty cell, which is kept.

  3. 3

    Copy the markup into a page

    The headline is the <table> element. Add a border in your own CSS if you want a grid.

Worth knowing

  • HTML Table Generator on Toolspire: the first non-empty line is the header. Every line after it is a body row.
  • A line that contains a tab is split on tabs. Otherwise it is split on commas.
  • Name,Score and Ada,10 become a table with those two headers and one body row.
  • <, > and & in a cell are escaped, so a cell cannot smuggle a tag into the markup.

Commas inside a quoted CSV are not parsed

This generator splits on tabs when it sees one, and otherwise on every comma. It does not understand quotes. A cell written as "Smith, Ada" will break into two cells. Export as TSV, or remove the commas inside cells, before you paste. Escaping is only for HTML: ampersands and angle brackets. Quotes are left as quotes.

FAQ

Questions about HTML Table Generator

Where does HTML Table Generator run?

HTML Table Generator runs in this tab on Toolspire. What you type or drop in is not sent to us and is not stored on a server.

Which row becomes the header?

The first non-empty line. It is wrapped in <thead><tr><th>.

Can I paste from a spreadsheet?

Yes, if the paste is tab-separated, which is what a spreadsheet copy usually is. Tabs are preferred over commas.

What happens to a less-than sign in a cell?

It becomes &lt; so the cell stays text.

Does this support colspan?

No. Every cell is one column. Merged spreadsheet cells will not be reconstructed.

Keep going

Open the full directory

Last updated Report a problem or suggest a feature