learn2kode.in

CSS Tables

CSS allows you to style HTML tables to improve readability and appearance. You can control borders, spacing, padding, colors, and more. Key properties include:

Example

Property Description Example
border Defines table borders border: 2px solid black;
border-collapse Combines adjacent borders border-collapse: collapse;
padding Adds space inside cells padding: 10px;
text-align Aligns text inside cells text-align: center;
background-color Changes background color of table/row/cell background-color: lightblue;

This example demonstrates how to make tables readable and visually appealing.