---
id: howto-css-table-center
title: "How To - Center Tables"
category: "Web_Recipes"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["center table CSS"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.8
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["howto", "css", "w3schools", "tables", "centering"]
raw_sources: ["https://www.w3schools.com/howto/howto_css_table_center.asp"]
applied_in: []
github_commit: ""
---

# [[HOWTO CSS Table Center]]

## 🎯 한 줄 통찰 (One-line insight)
This is the exact same `margin-left: auto; margin-right: auto;` mechanism used to center a page's content wrapper in `[[HOWTO CSS Center Website]]`, applied to a `<table>` instead — and the page explicitly flags the same underlying constraint that recipe relied on: a `<table>` set to `width: 100%` CANNOT be centered, because auto margins only distribute space the element ISN'T already using, and a full-width table leaves none. [S1]

## 🧠 핵심 개념 (Core concepts)
- **`margin-left: auto; margin-right: auto;`** — centers a table horizontally, the SAME mechanism as centering any block-level element with a constrained width. [S1]
- **Width constraint required** — like the website-centering recipe, this only works if the table does NOT span `width: 100%`. [S1]

## 📖 세부 내용 (Details)
- `.center { margin-left: auto; margin-right: auto; }` applied to `<table class="center">`. [S1]

## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **웹사이트 중앙 정렬과 동일한 원리**: `[[HOWTO CSS Center Website]]`에서 확인된 "margin:auto는 명시적 폭 제약이 있어야 동작한다"는 규칙이 테이블에도 동일하게 적용된다는 점이 확인됨 — width:100% 테이블은 중앙 정렬할 여백 자체가 없어 불가능. [S1]

## 🛠️ 적용 사례 (Applied in summary)
Firstname/Lastname/Age 컬럼을 가진 테이블을 margin:auto로 페이지 중앙에 배치하는 예제가 원문에서 직접 제시됨. [S1]

## 💻 코드 패턴 (Code patterns)
Centering a table — only works without width:100% (CSS):
```css
.center {
  margin-left: auto;
  margin-right: auto;
}
```

## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference)
- **신뢰 점수:** 0.80
- **중복 검사 결과:** 신규 생성 (New discovery)

## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[W3Schools HOW TO]]
- **관련 개념:** [[HOWTO CSS Center Website]], [[HOWTO CSS Table Full Width]]
- **참조 맥락:** CSS Layout & Positioning 섹션.

## 📚 출처 (Sources)
- [S1] W3Schools — How To - Center Tables — https://www.w3schools.com/howto/howto_css_table_center.asp

## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "How To - Center Tables" recipe (Astra wiki-curation, P-Reinforce v3.1 format).
