CSS Table Styler
Style your HTML tables with CSS instantly. Choose from pre-built table styles or customize borders, colors, padding, and more. Copy the CSS code and use it on your website.
Live Preview
| Name | Department | Status |
|---|---|---|
| Alice Johnson | Engineering | Active |
| Bob Martinez | Marketing | Active |
| Carol White | Finance | On Leave |
Customize your table style on the left, then click Generate CSS Code to get the output.
Pre-Built Table Styles You Can Apply Instantly
This tool gives you five ready-to-use CSS table presets that cover the most common design patterns used in websites and web apps. Each preset is production-ready and works across all modern browsers. Select a preset, adjust colors and spacing to match your brand, then click Generate CSS Code to get the complete stylesheet output. For more advanced AI-powered styling, use the chat panel on the left.
Style Tables with CSS
CSS table styling works by targeting the table, th, td, and tr elements in your HTML. The most important property is border-collapse: collapse, which merges adjacent cell borders into a single line for a clean appearance. Without it, each cell has its own double border by default. You can pair CSS table styles with a generated HTML table structure or with our free AI HTML table generator for a complete table solution.
Available Style Options
The tool offers five style presets: Minimal uses a clean light header with subtle bottom borders — ideal for documentation or simple data display. Striped Rows alternates row background colors for easier scanning across wide tables. Bordered adds a full grid of visible borders on every cell, useful for dense data tables or spreadsheet-style displays. Dark Theme uses a dark background palette with light text, suitable for dashboards with dark UI. Hover Highlight adds a blue highlight when the user hovers over any row, which helps users track data across columns. For generating an entire HTML and CSS page layout around your table, the AI CSS generator can help.
Customize Colors, Borders, Padding, and Fonts
Beyond presets, the tool lets you override every visual property individually. Color pickers control the header background, row background, alternate row background, border color, and text color. Number inputs adjust cell padding (the space inside each cell), border width, border radius (for rounded corners), and font size. These settings update the live preview table in real time, so you can see exactly what your table will look like before generating the CSS.
How to Use the Tool
Choose a Preset
Select from Minimal, Striped Rows, Bordered, Dark Theme, or Hover Highlight to start with a pre-configured style.
Customize Your Colors
Use the color pickers to set header background, row background, alternate row, border color, and text color to match your brand.
Adjust Spacing and Sizing
Set cell padding, border width, border radius, and font size using the number inputs. Changes update the live preview in real time.
Enable Optional Features
Check the Responsive, Hover Effect, or Rounded Corners checkboxes as needed for your use case.
Generate and Copy
Click Generate CSS Code to output the complete CSS. Click Copy CSS to copy it to your clipboard, then paste into your stylesheet.
Using Presets vs Custom Styles
Presets are the fastest way to get a complete, well-balanced table style. They are designed to work together as a unit — colors, borders, and spacing are balanced for visual consistency. When you pick a preset, the color pickers update automatically to reflect the preset's defaults, but you can still override any value. Custom styles are best when you have a specific brand palette or need to match an existing design system. In that case, start from any preset as a base and adjust individual properties rather than starting from scratch. If you need to generate matching CSS for your entire page including navigation, headings, and layout, the AI CSS generator handles that level of full-page styling.
Responsive Tables That Look Good on Mobile
Tables are one of the hardest elements to make responsive because they require a minimum width to display data correctly. When a table is wider than the viewport, it either overflows off-screen or forces the page to scroll horizontally. The most reliable CSS solution is to wrap the table in a container div with overflow-x: auto. This allows the table to maintain its structure while giving users a horizontal scrollbar on smaller screens.
Website Data Tables
Data tables on websites typically display structured information such as pricing plans, product comparisons, feature lists, or statistics. For this use case, the Striped Rows or Minimal presets work well. Striped rows make it easier to track data horizontally across many columns, while the Minimal preset keeps the focus on the data without visual distraction. Keep font size between 13 and 15px and cell padding between 10 and 14px for comfortable reading density. Avoid borders on every cell for data-heavy tables as it creates visual clutter — use bottom borders only.
Dashboard and Admin Panels
Admin panels and dashboards require tables that work inside complex layouts with sidebars, cards, and multiple data panels. The Hover Highlight preset is particularly well-suited here because it gives users immediate visual feedback when reviewing records. For dark-themed admin dashboards, the Dark Theme preset provides the right background palette. Combine it with a reduced font size of 13px and tighter padding to fit more records on screen without scrolling. If you are building the entire dashboard in HTML and CSS from scratch, the AI HTML generator can scaffold the layout.
Responsive Tables for Mobile
When the Responsive checkbox is enabled, the generated CSS includes a .table-wrapper class with overflow-x: auto. Wrap your table in a <div class="table-wrapper"> in your HTML to activate horizontal scrolling on small viewports. This is the most widely-supported responsive table technique and works in all browsers including older mobile versions. For a fully responsive HTML layout generator, the AI responsive generator builds complete responsive page structures.
Copy the CSS and Drop It Into Your Site
Once you have configured your table style and clicked Generate CSS Code, the output box shows the complete CSS ready to paste. The code uses standard CSS selectors targeting table, th, td, and tr:nth-child(even) — no class names or IDs required. Paste it into your existing CSS file, a <style> block in your HTML, or a CSS module. If you have multiple tables on a page with different styles, scope the selectors by adding a wrapper class.
Minimal Clean Table
The Minimal preset generates a clean table with a light gray header row, subtle bottom borders on each cell, and a white row background. It uses no left, right, or top borders, which gives the table an open, modern feel. This style works in virtually any context — blog posts, product pages, documentation, marketing landing pages. It is the least opinionated design and the easiest to match to any color scheme by simply changing the border color and header background.
Striped Row Table
Striped rows use the CSS :nth-child(even) selector to alternate the background color of every second row. This zebra-striping pattern significantly improves readability for tables with many rows or wide columns by giving the eye a horizontal guide. The Striped preset defaults to a dark gray header with white and light gray alternating rows, but the color pickers let you set any combination. The alternate row color should be a slightly lighter or darker version of the primary row color — too much contrast between rows looks busy.
Dark Theme Table
The Dark Theme preset uses near-black and dark gray backgrounds with light gray text. It pairs with dark UI designs, code documentation, developer tools, and any application where the overall page background is dark. The alternating row colors in dark mode use very close shades of dark gray — enough to see the difference without jarring contrast. When building CSS for dark mode, remember that the table needs to inherit or override the page's color scheme. If your site uses a prefers-color-scheme: dark media query, you can copy the dark preset's values into your dark mode ruleset.
FAQ
Common questions about styling HTML tables with CSS, using this tool, and applying the generated code to your website.
How do I apply CSS to an HTML table?
Copy the generated CSS from this tool and paste it into your stylesheet or a <style> block in your HTML file. The CSS targets the table, th, and td elements directly, so it applies to any table on the page. If you want to apply different styles to different tables, wrap each table in a uniquely-classed container and scope the CSS selectors accordingly — for example, .my-table table .
How do I make striped rows?
Striped rows use the CSS :nth-child(even) pseudo-class to target every second row. The rule tr:nth-child(even) td { background-color: #f3f4f6; } applies a light gray background to even-numbered rows, creating the alternating pattern. You can swap even for odd if you want the first data row highlighted instead. Use the Striped Rows preset in this tool to get the full working code, then adjust the alternate row color with the color picker.
How do I make a table responsive?
Enable the Responsive checkbox in this tool to include .table-wrapper { overflow-x: auto; } in the generated CSS. Then wrap your table in <div class="table-wrapper">...</div> in your HTML. On mobile screens, the table will scroll horizontally inside its container instead of overflowing the page. This is the most compatible approach and requires no JavaScript. For full responsive layout generation, see the AI responsive generator.
Can I customize the colors?
Yes. Every color in the tool is fully customizable. Use the color pickers to set the header background, row background, alternate row background, border color, and text color. The live preview updates in real time as you adjust. You can also type a hex value directly into the text field next to each color picker. After customizing, click Generate CSS Code to output the complete stylesheet with your chosen colors.
Does it work with all browsers?
Yes. All CSS properties used in the generated output — border-collapse, :nth-child, :hover, border-radius, and transition — are supported in all modern browsers including Chrome, Firefox, Safari, and Edge, as well as mobile browsers. The border-radius on tables requires overflow: hidden which is also included in the output when Rounded Corners is enabled.
How do I add hover effects?
Either select the Hover Highlight preset or check the Hover Effect checkbox for any preset. The generated CSS includes tr:hover td { background-color: #eff6ff; transition: background-color 0.15s ease; } which highlights the entire row in a soft blue on hover. The transition makes the highlight appear smoothly rather than snapping. You can customize the hover color by editing the background-color value in the generated CSS after copying.
What is css table styles?
CSS table styles are the set of CSS rules applied to HTML table elements to control their visual appearance. They define how the table, its headers, rows, and cells look — including colors, borders, spacing, fonts, and interactive effects. A complete CSS table style covers the table element for overall layout, th for header cells, td for data cells, and optionally tr:nth-child and tr:hover for striped and hover effects.
What is table css style?
Table CSS style refers to the CSS properties and rules that define the visual appearance of an HTML table. Key properties include border-collapse to control border rendering, padding for cell spacing, background-color for header and row colors, and border for visible grid lines. This tool generates all of these for you based on your selected preset and customizations.
What is table css styles?
Table CSS styles is the plural term for the collection of CSS rules used to style HTML tables. In practice, a well-styled table requires multiple rules working together — one for the table container, one for header cells, one for data cells, and optionally rules for alternating rows and hover states. This tool generates all of these as a single, ready-to-paste CSS block. You can also use the AI chat panel on the left to generate table CSS styles from a plain-language description.
What is table using css?
A table using CSS refers to an HTML table element that has been visually styled with CSS rules rather than using deprecated HTML attributes like bgcolor, border, or cellpadding. Modern web development uses CSS for all visual styling, keeping HTML markup clean and semantic. This allows you to change the table's appearance without touching the HTML, and makes it easier to apply different themes or responsive behavior. Use this tool to generate the CSS, then apply it to any standard <table> element in your HTML. For generating the table HTML itself, try the free AI HTML table generator.