Skip to content
Tezmy Tools

HTML Table Generator

Type or paste cells and get clean HTML or Markdown table code

4 rows × 3 columns (up to 50 × 12)
Paste from a spreadsheet or CSV

Output

<style>
.data-table { border-collapse: collapse; width: 100%; }
.data-table th, .data-table td { border: 1px solid #ccc; padding: 8px 12px; text-align: left; }
.data-table th { background: #f3f4f6; }
</style>
<table class="data-table">
  <thead>
    <tr>
      <th scope="col">Item</th>
      <th scope="col">Price</th>
      <th scope="col">Stock</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Notebook</td>
      <td>$4.50</td>
      <td>120</td>
    </tr>
    <tr>
      <td>Pen</td>
      <td>$1.20</td>
      <td>300</td>
    </tr>
    <tr>
      <td>Bag</td>
      <td>$18.00</td>
      <td>45</td>
    </tr>
  </tbody>
</table>

Runs in your browser. Nothing is uploaded.

About the HTML Table Generator

HTML Table Generator turns a grid of cells into clean table code you can paste into a web page, a blog post, an email template or a README. Type into the grid, add or remove rows and columns up to 50 by 12, or paste cells copied from a spreadsheet or a CSV file to fill it at once. Choose whether the first row is a header, add a caption and pick a style: no style, borders, striped rows or minimal lines. The tool writes proper HTML with thead, tbody and th elements, escapes special characters and can include a small block of CSS with the class name you choose. If you prefer Markdown, switch the output and copy a GitHub-style table. It all runs in your browser.

Updated September 2026

How to use the HTML Table Generator

  1. 1Type into the grid, or open Paste from a spreadsheet and paste cells or CSV text.
  2. 2Add or remove rows and columns to match your data.
  3. 3Tick First row is a header, add a caption if you like and choose a style.
  4. 4Pick HTML or Markdown output.
  5. 5Press Copy and paste the code into your page or document.

When an HTML table is the right choice

Tables are for data with rows and columns, such as prices, schedules, comparisons and results. They are not for laying out a page. Search engines and screen readers understand a well-built table, especially when it has a header row and a caption, and readers can compare values at a glance.

Writing the tags by hand is slow and error-prone, since every cell needs its own opening and closing tag. Typing into a grid and copying the code takes seconds.

Accessible by default

  • The header row uses th elements with scope=col so screen readers can announce column names.
  • A caption gives the table a title that assistive tools can read.
  • Real thead and tbody sections keep the structure clear for browsers and tools.
  • Text is escaped, so content never breaks the markup.

Styles and class names

The four styles cover most needs: plain lets your own stylesheet take over, borders draws a light grid, striped alternates row colours for long tables and minimal draws only thin lines between rows. The CSS uses the class name you enter, so several tables can share one style. If your class name has spaces or symbols, the tool cleans it into a valid name.

When you already have table styles in your site, untick Include the CSS and paste only the table. For emails, inline styles are safer, so add them by hand after copying.

Related tools

CSV to JSON converts the same data for code, CSV Tools reorders or removes columns before you build a table, Code Minifier shrinks the CSS and HTML, HTML to Text Converter strips markup back to plain text and Lorem Ipsum Generator provides sample content to test your layout.

Features

  • Grid of up to 50 rows and 12 columns
  • Paste from Excel, Google Sheets or CSV
  • Proper thead, tbody, th and caption elements
  • Four styles with optional CSS included
  • Custom class name
  • HTML special characters escaped
  • Markdown table output
  • Runs in your browser

Frequently asked questions

How do I create an HTML table?

Type your data into the grid, tick First row is a header if it holds column names and press Copy HTML. You get a table element with a head and a body, ready to paste into any web page or content system that accepts HTML.

Can I paste a table from Excel or Google Sheets?

Yes. Copy the cells in your spreadsheet, open Paste from a spreadsheet, paste them and press Replace the table. Tab-separated cells and CSV text are both understood, and quoted cells with commas or line breaks are read correctly.

What does the included CSS do?

It is a small style block that uses your class name to add borders, striped rows or light lines and padding to the table. Switch it off if your site already has table styles, and the HTML will contain only the table and its class.

Are special characters handled?

Yes. Ampersands, angle brackets and quotes in your cells are turned into HTML entities, so a cell such as A & B or 5 < 6 will show correctly and cannot break the table or inject markup.

How do I make a Markdown table?

Choose Markdown in the output options. The first row becomes the header, a dashed line follows, and pipe characters inside cells are escaped. GitHub, GitLab and many blog systems can display it.

Is the table responsive on phones?

The generated table uses the full width of its container. For wide tables on small screens, wrap it in a div with overflow-x set to auto so it scrolls sideways instead of squeezing.

Can I merge cells or set column widths?

No. The generator makes a simple grid without colspan, rowspan or widths, which suits most data tables. Add those attributes by hand in the copied code if you need them.

Related tools