๐ฒ HTML Table Generator
| Name | Age | City |
|---|---|---|
| Alice | 30 | Tokyo |
| Bob | 25 | Osaka |
Automatically generate HTML table markup from tab-separated data copied out of a spreadsheet, or from comma-separated data. Includes a live preview so you can check how it looks.
How to use
- Enter your data, one record per line (cells separated by commas or tabs).
- Toggle "First row is header" as needed.
- Copy the generated HTML code with the "Copy" button.
How the calculation works
This tool builds an HTML <table> with each line of input as a row and each separated value as a cell. If a line contains a tab, it is read as tab-separated; otherwise as comma-separated. Copying a range from Excel or a spreadsheet puts tabs between cells and line breaks between rows, so pasting it straight in is recognised as a table. The first line becomes the header, output as <th> inside <thead>; the rest become <td> cells inside <tbody>. Using <th> lets assistive technology such as screen readers tell headers from data. "&", "<" and ">" inside cells are converted to &, < and > so they are not interpreted as HTML.
Worked example
Pasting this range copied from a spreadsheet Item Price Apple 120 Orange 80 produces (excerpt) <table> <thead> <tr> <th>Item</th> <th>Price</th> </tr> </thead> <tbody> <tr> <td>Apple</td> <td>120</td> </tr> โฆ </tbody> </table>
Things to be aware of
- With comma-separated input, commas inside cells are also treated as separators. Use tab-separated input for data containing commas.
- Merged cells (colspan, rowspan) are not supported.
- The generated HTML has no classes or styles; style it with CSS.
- Leading and trailing spaces in each cell are removed.
FAQ
Can I paste directly from Excel or Google Sheets?
Yes โ cell ranges copied from a spreadsheet are tab-separated, so pasting them straight into the input box is automatically recognized.
Does this handle cell values that contain commas?
With comma-separated input, a comma inside a cell would be misread as a column separator. For data containing commas, use tab-separated input (pasted from a spreadsheet) instead.
Does the generated HTML include CSS classes?
No โ it generates a plain <table><thead><tbody> structure with no class names or styling. Add those manually if you need them.