--- id: w3css-tabulators title: "W3CSS Tabulators" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["navigation tabs", "tabbed content", "openCity", "W3.CSS νƒ­"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.87 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["w3css", "css-framework", "w3schools", "tabs"] raw_sources: ["https://www.w3schools.com/w3css/w3css_tabulators.asp"] applied_in: [] github_commit: "" --- # [[W3CSS Tabulators]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) Tabbed navigation has NO dedicated `w3-tab*` class family at all β€” it's fully assembled from primitives already covered in earlier chapters (`w3-bar`/`w3-button` for the clickable tab strip, plain `display:none`/`display:block` toggling for content panels), demonstrating that W3.CSS deliberately favors composing existing utilities over adding single-purpose components for every UI pattern. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Same-class content panels** β€” all tab panels share one class (e.g. `city`), and JS loops over `getElementsByClassName` to hide all before showing the target one. [S1] - **`openCity()` pattern** β€” the canonical two-step JS: hide everything with the shared class, then set the target element's `display` to `block`. [S1] - **Active-tab highlighting** β€” mirrors the accordion pattern: loop over elements with a shared `tablink` class, strip a color class from all, then add it to `evt.currentTarget`. [S1] - **Vertical tabs** β€” swapping the tab strip's container to `w3-sidebar w3-bar-block` turns horizontal tabs into vertical ones with zero change to the panel-toggling JS. [S1] - **Closable tab content** β€” reuses the `w3-display-container`/`w3-display-topright` overlay-positioning pattern with an inline `onclick="this.parentElement.style.display='none'"`. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Core toggle function: `function openCity(cityName) { var i; var x = document.getElementsByClassName("city"); for (i = 0; i < x.length; i++) { x[i].style.display = "none"; } document.getElementById(cityName).style.display = "block"; }`. [S1] - Active-tab color highlighting variant: `tablinks[i].className = tablinks[i].className.replace(" w3-red", ""); ... evt.currentTarget.className += " w3-red";`. [S1] - Vertical tab strip: ``. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) - ν˜„μž¬κΉŒμ§€ 발견된 λͺ¨μˆœ 사항 μ—†μŒ (No contradictions found in available sources). ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” 이미지 κ°€λŸ¬λ¦¬μ— νƒ­ μ „ν™˜ λ‘œμ§μ„ κ·ΈλŒ€λ‘œ μž¬μ‚¬μš©ν•˜λŠ” "Tabbed Image Gallery" νŒ¨ν„΄μ΄ openCity() ν•¨μˆ˜μ˜ λ²”μš©μ„±μ„ λ³΄μ—¬μ£ΌλŠ” μ‹€μ „ 사둀닀. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) The canonical tab-toggling JavaScript pattern reused throughout the chapter: ```javascript function openCity(cityName) { var i; var x = document.getElementsByClassName("city"); for (i = 0; i < x.length; i++) { x[i].style.display = "none"; } document.getElementById(cityName).style.display = "block"; } ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.87 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[W3.CSS Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[W3CSS Sidebar]], [[W3CSS Accordions]], [[W3CSS Pagination]] - **μ°Έμ‘° λ§₯락:** UI Components μ„Ήμ…˜ 첫 ν•­λͺ© β€” νŽ˜μ΄μ§€λ„€μ΄μ…˜(Pagination) μ±•ν„°λ‘œ 이어짐. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” W3.CSS Navigation Tabs β€” https://www.w3schools.com/w3css/w3css_tabulators.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "W3.CSS Navigation Tabs" page (Astra wiki-curation, P-Reinforce v3.1 format).