--- 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 `` instead β€” and the page explicitly flags the same underlying constraint that recipe relied on: a `
` 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 `
`. [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).