How to Generate Clean HTML Table Markup With Headers and Borders in Seconds
Learn how to set rows and columns with sliders, toggle a thead section and default border attributes, and copy placeholder table code to fill in.
HTML Table Generator
Introduction
Typing nested table, tr, th and td tags by hand is tedious and a missed closing tag breaks the layout. The HTML Table Generator writes the full skeleton from a row and column count, with optional header and border attributes, so only the cell contents need editing. Generation happens in the browser.
Step-by-Step Instructions
- Drag Number of Rows (1 to 10) to set how many body rows the table has.
- Drag Number of Columns (1 to 6) to set how many cells each row contains.
- Tick Include Table Header to add a thead with a th cell per column, or untick it for a body-only table.
- Tick Include Default Table Attributes to add border, cellpadding and cellspacing to the table tag.
- Review the markup in Generated HTML Table Code and press Copy Code to copy it.
Key Use Cases
- Documentation Tables: Scaffold a three-column spec table and replace the placeholder cells with real values.
- Email Layouts: Generate a bordered table skeleton for HTML emails that need table-based structure.
- Learning HTML: See how thead, tbody, tr, th and td nest correctly for a given grid size.
Frequently Asked Questions
What exactly does the Default Table Attributes option add?
It writes the opening tag as table border="1" cellpadding="8" cellspacing="0". These are HTML attributes rather than CSS, so remove them and use a stylesheet if the project avoids presentational attributes.
What text goes in the cells?
Header cells are labelled Header 1, Header 2 and so on, and body cells read Row r, Cell c. The tool does not accept custom cell content, so edit the placeholders after pasting the code into an editor.
Is there a limit on table size?
Yes. The sliders allow 1 to 10 rows and 1 to 6 columns, which covers most inline tables. For larger grids, generate the maximum and duplicate rows in the editor, since each row follows the same pattern.