HTML Table Generator
Create HTML tables easily. Enter data in the grid below or import from CSV/Excel.
Add Row:
Add Column:
Header Scope::
Caption::
Table Width::
Table Height::
Bordered Table:
Border Width::
Border Color::
Cell Padding::
Border Collapse::
How to use HTML Table Generator
- 1
Enter your data
Fill in cells in the Grid Editor and add rows or columns, or paste CSV and Excel data in the CSV Import tab.
- 2
Style the table
Set basic options like bordered, striped, hover, and responsive, or open Advanced Options for ID, class, caption, and border colors.
- 3
Generate the table
Click Generate Table to build the HTML and preview exactly how it will look.
- 4
Copy the HTML
Open the HTML Code tab and use Copy HTML to paste the markup into your web page.
Generating Accessible, Well-Structured HTML Tables
What makes a good HTML table
HTML tables exist to present genuinely tabular data, rows and columns where the position of a value carries meaning, like a pricing matrix, a schedule, or a comparison chart. A correct table is more than a grid of cells; it is built from a small family of elements that describe roles: table wraps everything, thead and tbody separate the header from the body, th marks a heading cell, and td holds a data cell. This generator emits that full structure for you so the output is clean and standards-compliant.
Getting the structure right matters because browsers, search engines, and assistive technology all rely on it. A grid faked with divs may look like a table but communicates none of the relationships, whereas proper table markup tells every consumer of the page exactly how the data is organized.
Two ways to get your data in
You can build a table interactively in the Grid Editor, adding and deleting rows and columns and typing directly into each cell, which is ideal for small tables or quick edits. For anything already living in a spreadsheet, the CSV Import tab is faster: paste your data and it is parsed into the grid in one step.
The importer is flexible about separators. It accepts comma, tab, semicolon, and pipe delimited text, so a copy straight out of Excel or Google Sheets (which uses tabs) and a downloaded CSV (which uses commas) both work. Mark First row is header when your top line contains column titles, and those values become th cells in the thead instead of ordinary data.
A worked example
Paste three lines into CSV Import with the first marked as a header: Name, Email, Phone on line one, then two rows of contacts. The tool produces a table whose thead holds a single row of three th cells and whose tbody holds two tr rows of td cells. Enable Bordered and Striped Rows and the markup gains the classes and styles that draw cell borders and alternate row shading, so the preview matches exactly what will appear on your page before you ever copy the code.
Visual styling options
The Basic Options cover the styling you reach for most. Bordered draws lines around cells, Striped Rows shades alternating rows so long tables are easier to scan, and Hover Effect highlights the row under the cursor, which helps readers track across wide rows. Each option is reflected live in the preview.
For finer control, Advanced Options expose cell padding and spacing, border width and color, and the border-collapse mode, which decides whether adjacent cell borders merge into single lines (collapse) or stay as separate double lines (separate). You can also attach a custom ID and class so the table hooks into your existing stylesheet rather than relying solely on inline styles.
Captions and header scope for accessibility
A caption gives the table a visible, programmatically associated title, and you can place it at the top or bottom. It is the accessible way to name a table, far better than a nearby paragraph, because screen readers announce it as the table's label.
The Header Scope option is the single most important accessibility setting here. Setting scope to col on header cells tells assistive technology that each th labels the column beneath it; setting it to row labels the row beside it; and the combined option handles tables that have both a header row and a header column. With scope set correctly, a screen reader can announce the relevant headers as a user moves from cell to cell, so a value is read as Phone: 555-1234 rather than a bare, contextless number.
The responsive caveat
Tables are inherently wide, and a table with many columns will overflow a phone screen. The Responsive Table option addresses this by wrapping the table so it scrolls horizontally inside its container instead of breaking the page layout, which keeps every column intact and reachable. This is the safe default for data tables on small screens.
It is worth understanding the trade-off: horizontal scrolling preserves the data faithfully but asks the reader to scroll. There is no way to reflow a true data table into a single narrow column without losing the row-and-column relationships, so for genuinely tabular content, scrolling is the honest solution rather than a workaround.
Common mistakes to avoid
The most frequent misuse is reaching for a table to control page layout rather than to present data; modern CSS such as flexbox and grid is the right tool for layout, and tables should be reserved for tabular content. Another common slip is omitting header cells entirely, which leaves screen reader users without column context, so always promote your first row to a header when it contains titles. Finally, do not bury styling in long inline style attributes when a class would be cleaner and easier to maintain; use the ID and class fields to connect the table to a stylesheet.
Valid markup, generated privately
Everything is produced in your browser, so your table data never leaves your device, and the output is properly nested table, thead, tbody, th, and td markup ready to paste into any site, email, or documentation. Because the structure is standards-compliant, it renders consistently across browsers and remains accessible to the people and search engines that read your page.
Frequently asked questions
Can I import data instead of typing it?
Can I make the table responsive?
What styling options are available?
Will the generated code be valid HTML?
Is the table data sent anywhere?
Related tools
Keep going with these handy tools