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.
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
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
Use one row per line
Blank lines are dropped. A trailing comma creates an empty cell, which is kept.
- 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?
Which row becomes the header?
Can I paste from a spreadsheet?
What happens to a less-than sign in a cell?
Does this support colspan?
Keep going
Related tools
Last updated Report a problem or suggest a feature