--- id: css-table-alignment title: "CSS Table Alignment" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["table text-align", "table vertical-align", "table alignment", "th td alignment", "center table cell"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.88 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["css", "web", "frontend", "w3schools", "table", "text-align", "vertical-align"] raw_sources: ["https://www.w3schools.com/css/css_table_align.asp"] applied_in: [] github_commit: "" --- # [[CSS Table Alignment]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) `text-align` controls horizontal alignment and `vertical-align` controls vertical alignment of content inside `` and `` cells. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`text-align` = horizontal** β€” the CSS `text-align` property is used to set the horizontal alignment of the content in `` or ``. [S1] - **`vertical-align` = vertical** β€” the CSS `vertical-align` property sets the vertical alignment (like top, bottom, or middle) of the content in `` or ``. [S1] - **Defaults for headers vs data** β€” by default, the content of `` elements is center-aligned and the content of `` elements is left-aligned. [S1] - **Default vertical alignment** β€” by default, the vertical alignment of the content in a table is middle (for both `` and `` elements). [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Horizontal values** β€” `text-align` accepts `left` (aligns text to the left), `right` (aligns text to the right), and `center` (centers the text). [S1] - **Vertical sizing pairing** β€” to make a vertical alignment visible, give the cell a `height` and then set `vertical-align` (e.g. `bottom`). [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **Horizontal Alignment** The CSS `text-align` property is used to set the horizontal alignment of the content in `` or ``. Property values: [S1] - `left` β€” aligns the text to the left - `right` β€” aligns the text to the right - `center` β€” centers the text **Note:** By default, the content of `` elements is center-aligned and the content of `` elements is left-aligned. [S1] Center the content of `` elements: [S1] ```css td { text-align: center; } ``` Left-align the content of `` elements: [S1] ```css th { text-align: left; } ``` **Vertical Alignment** The CSS `vertical-align` property sets the vertical alignment (like top, bottom, or middle) of the content in `` or ``. [S1] **Note:** By default, the vertical alignment of the content in a table is middle (for both `` and `` elements). [S1] The example below sets the vertical text alignment to bottom for `` elements: [S1] ```css td { height: 50px; vertical-align: bottom; } ``` The source illustrates these rules with sample data tables containing Firstname/Lastname/Savings columns (e.g. Peter Griffin / $100, Lois Griffin / $150, Joe Swanson / $300). [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's own examples are the applied cases: centering `` content, left-aligning `` content, and bottom vertical alignment of `` with a 50px height. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Horizontal alignment (language: CSS): ```css td { text-align: center; } ``` Vertical alignment (language: CSS): ```css td { height: 50px; vertical-align: bottom; } ``` ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.88 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CSS Table Size]], [[CSS Table Styling]], [[CSS Table Responsive]] - **μ°Έμ‘° λ§₯락:** Referenced whenever aligning header or data content inside an HTML table. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” CSS Table Alignment β€” https://www.w3schools.com/css/css_table_align.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "CSS Table Alignment" page (Astra wiki-curation, P-Reinforce v3.1 format).