Writing a table by hand is fine for two rows. For twenty rows it gets boring fast, and one missing
</td> can push a whole column out of line. Here you type the data, flip a couple of switches,
and copy the result. The code it makes is semantic too: a proper <thead>,
<tbody>, <caption> and scope attributes, so screen readers
can make sense of it.
Everything runs in your browser. Nothing you type is uploaded.
Five short steps. Each one has a tiny example, so you can see the HTML that sits behind each option.
Step 1 Set the Size of Your Table
Pick how many rows and columns you need. You can change your mind any time:
- Rows and Columns boxes: type a number, up to 100 rows and 30 columns.
- + Row / + Column: adds one at the bottom or on the right.
- − Row / − Column: removes the last one. If it has text in it, you’ll be asked first.
Here’s the smallest table there is
Two rows, two columns:
<table>
<tr>
<td>Apples</td>
<td>3</td>
</tr>
<tr>
<td>Pears</td>
<td>5</td>
</tr>
</table>
💡 No lines between the cells? That’s normal. Tables have no borders until you add some CSS. Step 4 covers that.
Step 2 Type or Paste Your Data
Click a cell and start typing. The keyboard works like you’d expect:
- Tab: moves to the next cell on the right. Tab in the very last cell adds a new row.
- Enter: moves down a row (Shift+Enter moves up). Enter on the last row adds a new one.
- Paste data: already have it in Excel, Google Sheets or a CSV file? Copy it, click Paste data, paste, and click Fill table. You can also paste a block of cells straight into any cell of the grid.
Try it: paste some CSV
Paste this into Paste data. The quotes keep “Austin, TX” in one cell:
Name,Role,City
Sam,Designer,"Austin, TX"
Priya,Developer,Leeds
The tool writes this for you:
<table>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Role</th>
<th scope="col">City</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sam</td>
<td>Designer</td>
<td>Austin, TX</td>
</tr>
<tr>
<td>Priya</td>
<td>Developer</td>
<td>Leeds</td>
</tr>
</tbody>
</table>
Step 3 Add Headers and a Caption
Headers tell the reader (and screen readers) what each row or column is about. Tick Header row
and the first row becomes <th scope="col"> cells inside a <thead>. Tick
Header column and the first cell of every row becomes <th scope="row">.
A Caption is a short title for the table, and it’s the proper place for one, rather than a
heading floating above it.
Try it: both kinds of header
Header row, header column and a caption:
<table>
<caption>Opening hours</caption>
<thead>
<tr>
<th scope="col">Day</th>
<th scope="col">Open</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Monday</th>
<td>9:00 to 17:00</td>
</tr>
<tr>
<th scope="row">Saturday</th>
<td>10:00 to 14:00</td>
</tr>
</tbody>
</table>
💡 Browsers make <th> bold and centered by default. The generated CSS lines them up on the left like the other cells.
Step 4 Pick a Style
Choose Plain, Bordered, Striped, Compact or
Modern. With Include CSS on, you get a small <style> block
that only targets .data-table, so it won’t mess with other tables on your page. Turn it off if
your site already styles tables (Bootstrap, Tailwind or your own CSS) and you just want the bare markup.
Try it: borders and stripes
The key line is border-collapse: collapse. Without it you get double borders:
<style>
table { border-collapse: collapse; }
th, td { border: 1px solid #d1d5db; padding: 6px 10px; }
thead th { background: #e5e7eb; }
tbody tr:nth-child(even) { background: #f3f4f6; }
</style>
<table>
<thead>
<tr><th>Task</th><th>Owner</th></tr>
</thead>
<tbody>
<tr><td>Design</td><td>Sam</td></tr>
<tr><td>Build</td><td>Priya</td></tr>
<tr><td>Test</td><td>Alex</td></tr>
</tbody>
</table>
Step 5 Copy or Download the HTML
Switch the right panel between Preview and HTML code to check the result. Then:
- Copy HTML: copies the table (and its CSS, if it’s on), ready to paste into your page.
- Download: saves a complete .html page with your table in it, named after your caption.
- Keep going: paste it into the HTML Editor to build the rest of the page around it, or into the HTML Viewer to check it next to your other markup. If you edit the code by hand later and it gets messy, the HTML Formatter tidies it up again.
Need merged cells?
The generator makes simple grids. To merge cells, add colspan or rowspan by hand
after you copy, and remove the cells it now covers:
<tr>
<td colspan="2">Spans two columns</td>
</tr>
How do I make a table in HTML by hand?
Start with a <table> tag. Each row is a <tr>, and inside each row you put cells: <th> for a heading cell and <td> for a normal data cell. Every row should have the same number of cells, or the columns get out of line. That is all a basic table needs. Wrapping the heading row in <thead> and the rest in <tbody> is optional, but it is a good habit.
What is the difference between <thead> and <tbody>?
<thead> holds the heading row (or rows) that label your columns, and <tbody> holds the actual data. The browser shows them the same way unless you style them, but they help screen readers, they let you style the header on its own, and when a long table is printed, many browsers repeat the <thead> at the top of every page. Turn on "Header row" in the generator and you get both for free.
How do I add borders to an HTML table?
Use CSS, not the old border attribute. Something like "table { border-collapse: collapse; } th, td { border: 1px solid #ccc; padding: 8px; }" gives you neat single lines around every cell. border-collapse is the important part: without it, every cell gets its own box and you see double lines. In the generator, pick the Bordered, Compact or Modern style and keep "Include CSS" on.
How do I merge cells in an HTML table?
Add colspan to a cell to make it stretch across columns, or rowspan to make it stretch down across rows. For example, <td colspan="2"> takes up the space of two cells. Then delete the cells it now covers from that row (or from the rows below, for rowspan), or the table gets an extra column. This generator makes simple grids, so do merges by hand: copy the HTML, add colspan or rowspan, and check the result in the HTML Viewer.
Can I paste data from Excel or Google Sheets?
Yes. Select the cells in your spreadsheet, copy them, then click "Paste data" and paste them in. You can also paste straight into any cell of the grid, and the data fills in from that cell. Copied spreadsheet data is tab-separated, and CSV with commas or semicolons works too, including "quoted, values" that contain commas. The limit is 100 rows by 30 columns.
Are HTML tables bad for page layout?
Yes, for layout they are. Years ago people built whole pages out of tables, and it was painful: hard to change, bad on phones, and confusing for screen readers, which announce it as data. Today, use CSS Grid or Flexbox to place things on a page. Tables are still exactly the right tool for tabular data, like prices, schedules, results or comparisons, where each row and column means something.
Is my table data uploaded anywhere?
No. The table is built in your browser, and the preview runs in a sandboxed frame on your own device. Nothing you type or paste is sent to a server, and nothing is saved, so copy or download your HTML before you close the tab.