---
id: css-table-borders
title: "CSS Table Borders"
category: "Frontend"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["table borders", "border-collapse", "border-spacing", "CSS tables", "table styling", "collapse borders"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.89
created_at: 2026-06-23
updated_at: 2026-06-23
review_reason: ""
merge_history: []
tags: ["css", "web", "frontend", "w3schools", "tables", "borders"]
raw_sources: ["https://www.w3schools.com/css/css_table.asp"]
applied_in: []
github_commit: ""
---

# [[CSS Table Borders]]

## 🎯 한 줄 통찰 (One-line insight)
Adding borders to `table`, `th`, and `td` separately produces double borders by default; `border-collapse: collapse` merges them into a single border, while `border-spacing` (only with `separate`) controls the gap between separated cell borders. [S1]

## 🧠 핵심 개념 (Core concepts)
- **Border shorthand** — the CSS `border` property is a shorthand property for `border-width`, `border-style`, and `border-color`. [S1]
- **Double borders by default** — because the `<table>`, `<th>`, and `<td>` elements have separate borders, applying borders to all of them yields double borders. [S1]
- **Collapsing** — the `border-collapse` property sets whether table borders should collapse into a single border or be separated as in standard HTML. [S1]

## 🧩 추출된 패턴 (Extracted patterns)
- **Single-border table** — apply `border-collapse: collapse` to the table to merge adjacent cell borders. [S1]
- **Spaced cells** — set `border-collapse: separate` and use `border-spacing` to control distance between cell borders. [S1]
- **Outer border only** — apply the `border` property only to the `<table>` element (not to `th`/`td`) to draw a border around just the table. [S1]

## 📖 세부 내용 (Details)
**Table Borders** — to add borders to a table, use the CSS `border` property. The CSS `border` property is a shorthand property for `border-width`, `border-style`, and `border-color`. The example below specifies a black border for `<table>`, `<th>`, and `<td>` elements: [S1]
```css
table, th, td {
  border: 1px solid;
}
```

A border color can be added in the same shorthand: [S1]
```css
table, th, td {
  border: 1px solid green;
}
```

**Collapse Table Borders** — the tables above have double borders. This is because both the `<table>`, `<th>`, and `<td>` elements have separate borders. To remove double borders, use the `border-collapse` property: [S1]
```css
table {
  border-collapse: collapse;
}
```

The `border-collapse` property can have one of the following values: [S1]

| Value | Description |
|-------|-------------|
| `separate` | Default value. Borders are separated; each cell will display its own borders |
| `collapse` | Borders are collapsed into a single border when possible |

**Border Spacing** — the `border-spacing` property sets the distance between the borders of adjacent cells. This property works only when `border-collapse` is set to `separate`: [S1]
```css
table {
  border-collapse: separate;
  border-spacing: 15px;
}
```

**Borders Around the Table Only** — if you only want a border around the table, the `border` property should only be specified for the `<table>` element: [S1]
```css
table {
  border: 1px solid;
}
```

Dotted/styled or rounded border examples: "Not found in source" within the borders portion of this page. [S1]

## 🛠️ 적용 사례 (Applied in summary)
The page's own examples apply borders to `table`/`th`/`td`, collapse them with `border-collapse: collapse`, add spacing with `border-spacing`, and draw a border around the table only. No external project/commit applications found in the source.

## 💻 코드 패턴 (Code patterns)
Single (collapsed) border table (language: CSS):
```css
table, th, td {
  border: 1px solid;
}
table {
  border-collapse: collapse;
}
```
Spaced separate borders:
```css
table {
  border-collapse: separate;
  border-spacing: 15px;
}
```

## ⚖️ 비교 및 선택 기준 (Comparison & decision criteria)
The page contrasts the two `border-collapse` values. **`separate`** (the default) keeps each cell's borders independent and is the only mode in which `border-spacing` has any effect — choose it when you want visible gaps between cells. **`collapse`** merges adjacent borders into a single line — choose it to eliminate the default double-border appearance. The decision is whether spaced, individually-bordered cells or a single clean grid line is desired. [S1]

## ⚖️ 모순 및 업데이트 (Contradictions & updates)
No contradictions found in the source.

## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.89
- **중복 검사 결과:** 신규 생성 (New discovery)

## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[CSS Tutorial]]
- **관련 개념:** [[CSS Styling Lists]], [[CSS Styling Links]], [[CSS Font Shorthand]]
- **참조 맥락:** Referenced when applying and collapsing borders on HTML tables.

## 📚 출처 (Sources)
- [S1] W3Schools — CSS Table Borders — https://www.w3schools.com/css/css_table.asp

## 📝 변경 이력 (Change history)
- 2026-06-23: Initial draft synthesized from the W3Schools "CSS Table Borders" page (Astra wiki-curation, P-Reinforce v3.1 format).
