CSS Tables
Introduction to CSS Tables
CSS table properties allow you to control the appearance and layout of table elements.
CSS Table Properties
- border-collapse: Specifies whether table borders are collapsed or separated.
- border-spacing: Sets the space between table cells when borders are separated.
- table-layout: Controls the table layout algorithm (auto or fixed).
Example
table {
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid black;
padding: 8px;
}
Browser Support
All major browsers support table properties.