tables

Tailwind CSS Table

Tables are used to display data in a tabular format.

Class Name
Type
Description
tableComponentBase class for the table component.
table-borderlessModifierRemoves border from table.
table-strippedModifierFor table to show stripped rows.
table-stripped-columnsModifierFor table to show stripped columns.
table-pin-rowsModifierFor table to make all the rows inside thead and tfoot pinned.
table-pin-colsModifierFor table to make all the th columns pinned.
table-xsResponsiveTable with extra small size.
table-smResponsiveTable with small size.
table-lgResponsiveTable with large size.
hoverUtilityFor table rows hover effect.

Use the component class table to create a basic table.

Add utility classes border & border-base-content/25 for table with border.

Add the modifier class table-borderless for table without borders.

Add the utility class hover to each row <tr> for table with hover.

Add the utility class bg-{color}/{opacity} to highlight tr, td, or th elements with customizable colors and opacity levels.

Stripped tables provide distinct visual separation within the table.

Use the modifier class table-stripped for table with stripped rows.

Use the component class table-stripped-columns for table with stripped columns.

Add utility class rounded-lg to the wrapper div of table to create rounded table.The shape of the table but can be altered by using TailwindCSS Border Radius utility classes.

Add responsive class table-{size}, where size = xs|sm|lg for table of different sizes.

Pinned tables stick certain columns or rows while enabling horizontal or vertical scrolling, enhancing readability, and usability, particularly for large datasets.

Add component class table-pin-rows for tables featuring pinned rows, ensuring that rows containing th elements remain fixed until scrolled.

Add component class table-pin-columns for tables with pinned columns, ensuring that specified columns with th remain fixed while the rest of the table scrolls horizontally.

Exclude <thead> for headless tables to maintain structured data presentation with a minimalist appearance.

Use the <caption> tag in tables to provide a brief description or summary of the table content.

Utilize the <tfoot> tag in tables to define footer content.

Add utility class overflow-x-auto to make the table horizontally scrollable on small screens.

Add utility class shadow to the wrapper div of table to create table with shadow.The shadow can be adjusted using the TailwindCSS Box shadow utility classes.

Styled table headers improve the visual appeal of a table.

The product table exemplifies a table UI featuring search filters, pagination, and search functionality.

Add component class card to the wrapper div of table to create table with card.