Bootstrap 5 Table

In Bootstrap 5, creating and styling tables is simple and flexible with a variety of built-in table classes. These classes help you quickly design tables with different styles, colors, borders, and responsive behavior.

Basic Table:

To create a basic table, use the .table class:

Striped Rows:

Add the table-striped class to create striped rows for better readability.

Bordered Table:

Add the table-bordered class to create borders to all table cells.

Hoverable Rows:

Add the table-hover to highlight rows when hovered.

Responsive Table:

To make tables scrollable on smaller screens, wrap them in .table-responsive.

Small Table:

Use .table-sm to make a more compact table with smaller cell padding.

Table with Dark Theme:

Use .table-dark for a dark background with light text.

Contextual Classes:

Add row or cell-level styling with contextual classes:

Class

Description

.table-primary

Blue background

.table-secondary

Gray background

.table-success

Green background

.table-danger

Red background

.table-warning

Yellow background

.table-info

Light blue background

.table-light

Light background

.table-dark

Dark background

Aligning Content:

Use alignment classes inside table cells.

Class Name

Alignment

.text-start

Left align

.text-center

Center align

.text-end

Right align

Combining Styles:

Combine multiple classes for a styled table:


Whereisstuff is simple learing platform for beginer to advance level to improve there skills in technologies.we will provide all material free of cost.you can write a code in runkit workspace and we provide some extrac features also, you agree to have read and accepted our terms of use, cookie and privacy policy.
© Copyright 2024 www.whereisstuff.com. All rights reserved. Developed by whereisstuff Tech.