HTML Table Generator

Use this HTML table generator to build a table visually instead of hand-writing rows of tags. Choose the size, type into the cells, switch on headers and striping, and copy clean, ready-to-paste code.

1Set rows and columns
2Type into the cells
3Copy the table code

Private by design: 100% in your browser — nothing is uploaded, no sign-up. This tool runs entirely on your device.

HTML tables are simple in concept and tedious in practice. A modest price list is dozens of nearly identical tr, th and td tags, and one missing closing tag quietly breaks the layout of everything below it. This generator removes the tedium: you work in a friendly grid that looks like the finished table, and the tool writes the tags for you — correctly nested, properly escaped, and styled so it looks decent the moment you paste it.

The styling choices cover what most tables need. The header option converts your first row into real header cells, which is not just cosmetic: screen readers announce them as column labels, and search engines use them to understand the data. Striping shades alternate rows so the eye can follow a line across a wide table, and borders give the grid its structure. All of it is written as inline styles on the elements themselves, which makes the snippet portable — it will look the same in a hand-coded page, a WordPress block, or an HTML email, with no stylesheet to clash with.

Worked example: a café owner needs a price list with three columns — Item, Small, Large — and four drinks. She sets 5 rows (one header plus four drinks) and 3 columns, types "Espresso", "Flat White", "Latte" and "Hot Chocolate" down the first column with prices beside them, adds the caption "Price list 2026", and copies the code into her menu page. The generated table has a tinted header row, striped drink rows and full borders, and it took about two minutes. Next season she edits two prices directly in the pasted code, because plain HTML stays editable forever.

When a table is the right tool — and when it is not

Use a table forUse something else for
Price lists and plansPage layout (use CSS grid or flexbox)
Timetables and schedulesPhoto galleries
Product comparisonsLong articles (use headings and lists)
Results, scores and standingsNavigation menus

That first row of the "not" column matters. Using tables to lay out whole pages was common in the early web, but it fights against responsive design and accessibility, and modern CSS does the job far better. Tables have one job — data that genuinely belongs in rows and columns — and they do it superbly. If your content has two axes, like products against features or days against times, it belongs in a table.

Two habits will keep your tables in good shape. Keep cell text short: a table is for scanning, so move explanations into the paragraphs around it and let the cells hold values. And check the table on a phone before publishing; if it is wider than the screen, wrap it in a scrolling container so visitors swipe sideways through the data instead of zooming out on tiny text. The preview above uses exactly that technique.

Accessibility is the quiet benefit of doing tables properly. When the first row uses real header cells, as this generator produces, a screen reader can announce "Price — Small — 2.50" in context instead of reading a bare stream of numbers, which makes your data usable by everyone. Keep header text short and literal — "Small" beats "Our amazing small size" — and avoid merging cells or leaving blanks to suggest grouping; assistive technology handles plain, complete grids best. If a cell is genuinely empty, an empty cell is fine, but a row of them usually means the data wants restructuring.

Finally, keep the code somewhere safe once you are happy with it. Tables of prices, sizes or schedules tend to be reused — in emails, in a second page, in next season's version of the same page — and regenerating from scratch each time invites small inconsistencies. Paste the snippet into your project and edit the numbers in place; the structure will carry you through many updates.

Frequently asked questions

How do I add the generated table to my website?

Copy the code from the output box and paste it into your page's HTML where you want the table to appear. The styling is included inline, so the table looks right without editing your stylesheet.

What is the header row option?

It turns the first row into proper header cells (th elements) with a tinted background. Header cells tell browsers, search engines and screen readers what each column means, so use it whenever your first row contains labels.

Can I edit the table after pasting it?

Yes. The output is ordinary HTML: change the text between the td tags, copy a tr block to add a row, or adjust the inline styles. Or come back here, rebuild the table and paste the fresh code.

Why does the generated code use inline styles?

Inline styles make the snippet self-contained: it works in any page, CMS or email template without depending on your site's CSS. If you prefer classes, the structure is simple enough to restyle quickly.

How many rows and columns can I make?

Up to 20 rows and 20 columns, which covers price lists, timetables, comparison charts and schedules. For genuinely large datasets, a spreadsheet exported to HTML or a database-driven table is a better fit.

What does the striped option do?

It shades every second data row light grey. Striping helps readers track across wide tables without losing their place, and it is a purely visual choice — the data itself is unchanged.

Can I put links or bold text in a cell?

The generator treats cell text as plain text and escapes it safely. To add a link or emphasis, paste the table first, then wrap the cell's text in an a or strong tag in your own editor.

Is the generated table responsive on phones?

The table itself uses standard markup. On narrow screens, wrap it in a container with overflow-x auto so visitors can scroll sideways instead of squashing the columns — most site themes already do this.

Is this table generator free?

Yes, completely free, and everything happens in your browser — the contents of your table are never uploaded or stored anywhere.

Related tools