1. Table Borders & Collapse

By default, tables have "double" borders. The border-collapse property merges them into one.

table {
  border: 2px solid black;
  border-collapse: collapse;
}

Collapse: Merges borders.
Separate: Keeps default gaps.

BORDER-COLLAPSE: COLLAPSE

IDName
101Krishna J

2. Table Width

The width property controls how much horizontal space the table occupies.

table { width: 100%; }

Use percentages (%) for Responsive Design or pixels (px) for fixed sizes.

Width: 50%

Width: 100%

3. Cell Styling (th, td)

Padding

Adds "breathing room" inside each cell.

td { padding: 15px; }

Alignment

Aligns content (left, center, right).

td { text-align: center; }
Tight Padding Spacious Padding

4. Colors & Headers

Use background-color to make header cells (th) stand out from data cells (td).

th {
  background-color: #38bdf8;
  color: white;
}
Course Status
Java Full Stack Enrolling