We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
If this tool helped you, you can buy us a coffee ☕
Create HTML table code visually with drag-and-drop. Merge cells, customize styles, and copy the code in one click.
Supports the {row} and {col} placeholders.
Supports 1 to 20 rows/columns. Out-of-range values are corrected automatically.
| Header 1 | Header 2 | Header 3 | Header 4 | Header 5 |
|---|---|---|---|---|
| Row 1 Cell 1 | Row 1 Cell 2 | Row 1 Cell 3 | Row 1 Cell 4 | Row 1 Cell 5 |
| Row 2 Cell 1 | Row 2 Cell 2 | Row 2 Cell 3 | Row 2 Cell 4 | Row 2 Cell 5 |
| Row 3 Cell 1 | Row 3 Cell 2 | Row 3 Cell 3 | Row 3 Cell 4 | Row 3 Cell 5 |
| Row 4 Cell 1 | Row 4 Cell 2 | Row 4 Cell 3 | Row 4 Cell 4 | Row 4 Cell 5 |
| Row 5 Cell 1 | Row 5 Cell 2 | Row 5 Cell 3 | Row 5 Cell 4 | Row 5 Cell 5 |
| Row 6 Cell 1 | Row 6 Cell 2 | Row 6 Cell 3 | Row 6 Cell 4 | Row 6 Cell 5 |
This tool is for anyone who wants to display information in a table without writing HTML by hand. It is especially useful in these situations:
When you open the HTML Table Generator, you’ll see the canvas on the left and a code preview on the right. The workflow follows four simple steps: size, content, styling, and code.
If you change the row or column count by mistake, use “Undo” in the toolbar. “Clear Table” resets everything in one click.
Let’s create one of the most common examples: a weekly class schedule for a personal webpage. Assume the schedule has 5 rows and 6 columns, with weekday headings in the first row and time slots in the first column.
Steps:
Time / Day
8:00-9:30
Calculus
English
Physical Education
Computer Fundamentals
Study Hall
...(subsequent rows follow the same pattern)
Click “Copy Code,” then paste the snippet directly into your HTML file. Open it in a browser to see a class schedule with a colored header row.
The HTML in the code preview follows web standards and displays in all modern browsers. Check these key details to confirm your table looks as intended:
border="1" or style="border:1px solid ...", the table will have borders. If it does not, make sure you set a border width in the toolbar.colspan="number" or rowspan="number" attributes. Larger numbers mean more merged columns or rows. If merged cells are misaligned, you likely selected the wrong range—return to the canvas and merge the cells again.<table> snippet. It does not include <html> or <body> tags. Paste it inside the <body> of an existing HTML page so the browser can render it.width:100%, so they adapt to the width of their parent container. If you set a fixed pixel width, the table may overflow on narrower pages and require manual adjustment.width attribute to <td> or <th> after copying the code.Q: How do I add or remove rows and columns?
Change the values in the “Rows” and “Columns” fields, then click “Generate Table.” This creates a new table, so existing content will be lost. To keep any content, copy the code first and paste the data into the new table afterward.
Q: How do I split a merged cell?
Select the merged cell and click “Split Cells,” if the toolbar includes that option. If it does not, clear and regenerate the table, or copy the code and manually remove the colspan/rowspan attributes.
Q: Can I use the generated code in Word?
Word can paste HTML-formatted content, but some styling may be lost. Generate the table code, paste it into a webpage to review it, then take a screenshot or export it as a PDF for your Word document. You can also copy a screenshot of the table from the canvas.
Q: Will the table look distorted on mobile?
The table defaults to 100% width and scales with the screen, but tables with many columns or long content may require horizontal scrolling on small screens. You can wrap the table in a container with overflow-x:auto; this wrapper is not included automatically.
Try the table generator above now: create the rows and columns you need, enter your data, and copy the code in one click to add a polished table to any webpage.