HTML Table Generator

Style Presets
Layout
Header Settings
Cell Settings
Border Settings
Row Styling
Export

Live Preview

Click any cell to edit
<table class="my-table">
  <thead>
    <tr>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>

What is an HTML Table Generator?

An HTML Table Generator is a free online tool that lets you build custom HTML tables visually — without writing a single line of code. Configure rows, columns, headers, and styles, then copy the ready-to-paste HTML and CSS directly into your project.

How to Use the HTML Table Generator

  1. Choose a style preset or configure colors manually in the controls panel.
  2. Set the number of rows and columns using the +/− buttons or inputs.
  3. Click any cell in the live preview to edit the content directly.
  4. Switch between HTML, CSS, Markdown, or combined output tabs.
  5. Click Copy or Download .html file to export.

HTML Table Attributes Explained

Understanding the key HTML table attributes helps you write cleaner markup:

  • class — Links your table to CSS rules. Our generator uses the class name you set in the CSS Class Name field.
  • id — A unique identifier for JavaScript targeting. Use when you need to select this specific table via document.getElementById().
  • border — A legacy attribute (now handled by CSS). Always prefer border-collapse and CSS borders instead.
  • cellpadding — Also legacy. Use CSS padding on th and td elements instead.
  • cellspacing — Controls spacing between cells. Modern equivalent is border-spacing in CSS.
  • width — Sets table width. Use CSS width property instead for better control and responsiveness.

CSS Table Styling Guide

These CSS properties give you full control over how your table looks:

  • border-collapse: collapse — Merges adjacent cell borders into one. Almost always what you want.
  • border-spacing — Sets the gap between cells when border-collapse: separate is used.
  • tr:nth-child(even) — Targets every even row for alternating stripe colors.
  • tr:hover td — Highlights an entire row when the user hovers over it, improving readability.
  • overflow-x: auto — Applied to a wrapper div, this lets the table scroll horizontally on small screens without breaking layout.

When to Use HTML Tables

Tables are the right tool for structured, relational data:

  • Comparison charts (product features, pricing plans)
  • Financial data (budgets, invoices, statements)
  • Schedules and timetables
  • Sports statistics and leaderboards
  • Data exports from spreadsheets

Tables are not the right tool for:

  • Page layout — use CSS Grid or Flexbox instead
  • Image galleries — use a grid or masonry layout
  • Navigation menus — use nav with ul/li

Making Tables Accessible

Accessible tables improve the experience for screen reader users and assistive technologies:

  • thead / tbody / tfoot — Wrapping header rows in thead and data rows in tbody helps screen readers announce row context correctly.
  • scope attribute — Add scope="col" to th elements that head columns and scope="row" for row headers.
  • caption element — Provides a title for the table, announced before the content by screen readers. Add it as the first child of table.
  • summary attribute — A legacy attribute for complex tables. Prefer caption or aria-describedby in modern HTML.

Why Use an Online HTML Table Generator?

  • No coding knowledge required — visual, point-and-click interface
  • Instant live preview as you adjust settings
  • Clean, valid HTML and CSS output ready for any website
  • Export as HTML file, copy code, or get Markdown for editors like Notion
  • Works on mobile and desktop — no installation or signup needed

Frequently Asked Questions

What is an HTML Table Generator?

A free online tool that lets you visually configure and generate HTML table markup — no coding required. Set rows, columns, headers, and styles, then copy the result.

Can I copy the generated HTML code?

Yes. Once you configure your table, click the Copy button to copy the ready-to-use HTML code directly to your clipboard.

Does the generated table work in all browsers?

Yes. The generated HTML table code is standard HTML and CSS that works across all modern browsers including Chrome, Firefox, Safari, and Edge.

Is the HTML Table Generator free to use?

Yes, completely free. No signup, no account, and no usage limits.

How do I make an HTML table responsive?

Wrap your table in a div with overflow-x: auto CSS. This adds horizontal scroll on mobile devices without breaking the table layout. Our generator includes this CSS wrapper code automatically.

What is the difference between th and td in HTML tables?

th is used for table header cells — they are bold and centered by default and help screen readers understand the table structure. td is used for regular table data cells.

How do I add alternating row colors?

Use the CSS nth-child selector: tr:nth-child(even) { background: #f3f4f6; }. Our generator includes this automatically when you enable the Striped Rows option.

Can I edit the cell content in the table generator?

Yes. Simply click any cell in the live preview to edit the content directly. The generated HTML code updates automatically to reflect your changes.

How do I use the generated table in WordPress?

Switch your WordPress post editor to HTML/Text mode, then paste the generated HTML code. The table will render correctly in your post or page.

Can I export the table as Markdown?

Yes. Click the Markdown tab in the code output panel to get your table in Markdown format — compatible with GitHub, Notion, Obsidian and other Markdown editors.

Related Developer Tools

Subscribe to the Calcon newsletter

Get new calculators, tools, and practical guides delivered to your inbox. No spam — unsubscribe anytime.

HTML Table Generator Online Free – Create & Style HTML Tables - Calcon