Home/HTML & Markdown/HTML Table Generator

HTML Table Generator

Paste data from a spreadsheet and get accessible HTML — proper thead, scope attributes, caption and numeric alignment, with optional CSS, Bootstrap or Tailwind classes.

Free Browser-based No signup Copy-ready
Table Settings
Copy straight from Excel, Sheets or a CSV file — tabs, commas, semicolons and pipes are all detected.
A caption is the accessible name of a table. Screen-reader users hear it before the data.
Structure
Style options
Formatting
Generated Table
table.html

      

How it works

1

Paste your data

CSV, TSV or a copy from Excel or Sheets — the delimiter is detected for you.

2

Set the structure

Header row, header column, footer for totals, plus striping and responsive scrolling.

3

Copy the markup

Semantic HTML, HTML plus a stylesheet, inline styles for email, or framework classes.

What separates a real table from a grid of divs

Tables get a bad reputation from the layout-table era, but for actual tabular data they are the correct element and nothing else comes close. A properly marked-up table lets a screen-reader user move cell by cell and hear "Stock, USB-C Hub, 0" — a grid of divs gives them "0".

The four things that matter

  1. <thead> with <th scope="col"> for column headers.
  2. <th scope="row"> when the first column is a label rather than data.
  3. A <caption> so the table has an accessible name.
  4. <tfoot> for totals, so they are identified as a summary rather than another data row.

Everything else is styling. These four are what make the table usable without sight.

Practical details

  • Right-align numbers and use font-variant-numeric: tabular-nums so digits line up in columns. This tool detects numeric columns automatically.
  • Wide tables should scroll inside their own container, never force the page to scroll horizontally.
  • Zebra striping helps on wide tables and adds noise on narrow ones.
  • HTML email is the one place inline styles are correct — most clients strip <style> blocks.
The "responsive table" that stacks rows into cards breaks accessibility. Once each cell becomes its own block, the association between value and column header is gone unless you duplicate the label in a data-label attribute. A horizontally scrolling wrapper keeps the real table structure and is almost always the better answer.

Frequently Asked Questions

View all FAQs
What tags are used in an HTML table?
Common elements include <table>, <tr>, <th>, <td>, <caption>, <thead>, <tbody> and optionally <tfoot>.
Should table headers use or ?
Use <th> for cells that act as row or column headers.
What does scope="col" mean?
It identifies a header cell as applying to its column. scope="row" identifies a row header.
Why should I add a caption?
A descriptive caption helps users quickly understand the table’s purpose and provides useful accessible context.
Can I convert CSV into an HTML table?
Yes. Paste the delimited data and identify the header row. Correct CSV parsing should preserve quoted commas and line breaks.
How do I make a wide table responsive?
A common approach is a horizontally scrollable wrapper that preserves the semantic table structure.
Should I use HTML tables for page layout?
No. Use table markup for tabular data and modern CSS layout systems for page structure.

HTML Table Generator – Create Accessible Table Markup Online

Use the HTML Table Generator above to turn pasted rows or CSV-style data into clean HTML table markup without hand-writing every <tr>, <th> and <td>.

Paste your data, choose the delimiter and header behavior, then add semantic options such as a table caption, <thead>, <tbody> and scoped header cells. You can also generate optional styling for borders, striping, compact layouts or responsive horizontal scrolling.

A good HTML table is more than a visual grid.

When the content is genuinely tabular, the markup should express the relationship between headers and data cells so browsers, screen readers, copy tools and search systems can understand the structure.

What Is an HTML Table?

An HTML table represents data arranged in rows and columns.

The core elements are:

<table> — the table container

<tr> — a table row

<th> — a header cell

<td> — a data cell

For structured tables, you can also use:

<caption>
<thead>
<tbody>
<tfoot>

These elements describe what the data means.

Use tables for data with real row/column relationships.

Do not use them as a general page-layout system.

CSS Grid and Flexbox are better choices for non-tabular layout.

How to Use This HTML Table Generator

Paste data into the input area.

Choose the delimiter if the tool does not detect it automatically.

Indicate whether the first row contains column headings.

Then configure semantic output.

For most data tables, useful options include:

  • <thead>
  • <tbody>
  • header cells as <th>
  • scope="col" for column headers
  • a descriptive <caption>

Choose optional CSS only if you need styling with the generated markup.

Generate the table, inspect the live preview and review the accessibility output before copying it into your page.

A table can look correct visually while still having weak markup for assistive technology.

Use thead and tbody

<thead> groups the header rows.

<tbody> groups the main data rows.

Example structure:

<table>
  <thead>...</thead>
  <tbody>...</tbody>
</table>

These elements make the document structure clearer.

They also help with CSS targeting and table processing in JavaScript.

For complex tables, semantic row groups can improve the information available to assistive technology.

You do not need to add unnecessary wrappers around every small table, but for normal data tables, a clear head/body split is a strong default.

Use th for Headers

A table header is not just a bold <td>.

Use <th> when the cell labels a row or column.

For a standard table with headings across the top, the first row normally contains <th> cells.

For example:

Name | Department | Location

should be represented as headers, not styled data cells.

The semantic difference matters to screen readers and other software that navigates tables.

CSS can make any cell bold.

Only correct HTML communicates that the cell is actually a header.

What Does scope="col" Do?

The scope attribute helps identify which cells a header applies to.

For a column heading:

<th scope="col">Price</th>

For a row heading:

<th scope="row">Product A</th>

In simple tables, browser and assistive technology can often infer relationships.

Adding scope makes the association explicit and is especially useful when row headers are present.

For complicated multi-level tables, additional header association techniques may be necessary.

The generator is best suited to straightforward data tables where scoped row and column headers accurately describe the structure.

Add a Table Caption

A <caption> gives the table a name or short description.

It belongs inside the <table> and is normally placed immediately after the opening table tag.

Example:

<caption>Quarterly revenue by region</caption>

A caption helps all readers quickly understand what the table contains.

It is especially valuable for screen-reader users who may otherwise need to navigate into several cells before discovering the table’s purpose.

Avoid captions such as:

“Table 1”

when a more informative description is available.

Tell the reader what the data represents.

HTML Tables and Accessibility

Accessible table markup lets a user understand relationships that sighted users often infer from visual position.

Important practices include:

  • use <th> for actual headers
  • associate headers with rows or columns
  • add an informative caption where useful
  • keep the table structure logical
  • avoid empty fake header cells when possible
  • do not use a table only for visual layout

For a simple table, native HTML semantics are usually better than recreating a table from generic <div> elements and ARIA roles.

Native elements already carry table meaning.

Use ARIA to fill genuine semantic gaps, not to replace correct HTML unnecessarily.

Row Headers

Some tables have labels down the first column.

For example:

ProductQ1Q2Q3
Widget A.........
Widget B.........

The product names can be row headers rather than ordinary data cells.

Use:

<th scope="row">Widget A</th>

That tells assistive technology that the remaining cells in the row relate to Widget A.

The generator can help create the common column-header structure, but decide whether your first column is actually a row label rather than ordinary data.

Tables Are for Tabular Data

A table is appropriate when data has meaningful two-dimensional relationships.

Examples include:

  • price comparisons
  • schedules
  • specifications
  • financial results
  • test results
  • product matrices
  • reports

A table is usually not appropriate for:

  • page columns
  • card layouts
  • image galleries
  • navigation
  • form layout

Historically, HTML tables were used for page design because older CSS was limited.

Modern layout should use CSS.

Using semantic elements for their intended purpose improves accessibility and makes markup easier to maintain.

Convert CSV to HTML Table

CSV is a natural input for a table because it already contains rows and columns.

Paste data such as:

Name,Score,Status
Alice,92,Pass
Bob,84,Pass

and convert the first row into table headers.

Be careful with real CSV parsing.

A quoted field can contain commas or line breaks.

A robust converter should respect quoting rather than splitting every line on every comma.

If you need deliberately difficult CSV input for testing, use the CSV Test Data Generator first, then feed the output into your table workflow.

Escape HTML in Cell Values

Data inserted into HTML must be escaped correctly.

A value containing:

<

does not necessarily mean “start an HTML tag.”

If the cell value is plain text, it should remain text.

This is particularly important when table content comes from users, files or external systems.

Never concatenate untrusted text into raw HTML without appropriate escaping or sanitization.

A table generator can create safe markup from the data you provide, but application code should still follow normal cross-site-scripting protections when rendering dynamic values.

Responsive Tables

Wide tables can overflow narrow screens.

One practical approach is to wrap the table in a horizontally scrollable container.

This preserves the underlying table structure while allowing users to reach columns that do not fit on a phone.

Avoid solving responsive design by hiding important columns without considering whether users still need the information.

Also be cautious with CSS techniques that completely transform table rows into card layouts.

Those transformations can make header relationships harder to understand.

For complex mobile experiences, test both usability and accessibility.

HTML Table vs Markdown Table

Markdown tables are convenient for README files, documentation and systems that render Markdown.

HTML tables offer much more control over:

  • semantics
  • captions
  • row groups
  • scoped headers
  • CSS
  • complex cells
  • spanning

Use Markdown when the publishing system is Markdown-first and the table is simple.

Use HTML when accessibility control or layout complexity requires richer markup.

The Markdown Table Generator is useful when the same pasted data needs to become documentation markup instead of HTML.

Common HTML Table Mistakes

Avoid these problems:

  • Using <td> cells styled as headers instead of <th>
  • Omitting meaningful header relationships
  • Using tables for general page layout
  • Adding no caption when the table’s purpose is unclear
  • Injecting unescaped user data into table HTML
  • Creating mobile CSS that destroys the logical structure
  • Centering every numeric and text column indiscriminately
  • Using colspan and rowspan when several simpler tables would be clearer
  • Assuming visual bold text provides accessibility semantics
  • Rebuilding a table with divs when native table HTML already fits the content

Good table markup should still make sense when the decorative CSS is removed. To build a form dropdown from the same data, see the HTML Select Option Generator.

Related searches

html table generatoraccessible html tablecsv to html tablehtml table scope attributethead tbody html tabletable caption accessibilityresponsive html tablehtml table vs markdown tablehtml table th vs tdrow header scope rowhtml table escape user datasemantic html table