Communitygithub.com

Coast Digital Group / Data Table UI System

設計與實作資料表格的系統性框架,確保在複雜資料集中達到可讀性、可掃描性及結構完整性。

Data Table UI System 是什麼?

此技能提供一套設計與實作資料表格 UI 的系統性方法,主要針對需要呈現結構化、多屬性資料的場景。它透過制定明確的對齊規則、間距、視覺層級與互動元素,確保大型資料集易於掃描、比較與操作。支援的平台包括 SaaS 儀表板、電子商務產品比較、技術稽核日誌、財務報表等。工作流程涵蓋定義欄位類型與對齊、設定表頭視覺層級、選擇行密度、設計排序與選取等互動行為,以及處理內容長度變異與空值情況。技能也包含完整的無障礙規範(如語意化 HTML、WCAG 2.2)、響應式設計模式,以及常見的失敗模式與驗證標準,幫助開發者建立既美觀又實用的資料表格。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/coastdigitalgroup/coastai-skills/tree/HEAD/website-design/data-table-ui-system

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

資料表格 UI 系統

目的

資料表格 UI 系統技能提供一套組織與呈現結構化、多屬性資料的方法。它透過建立明確的對齊、間距、層級以及表格格式內互動元素的規則,確保大型資料集易於掃描、比較與操作。

使用案例

  • 為庫存管理、使用者管理或帳單功能設計 SaaS 儀表板
  • 為電子商務或行銷網站建立產品比較矩陣
  • 為技術應用程式實作日誌檢視器或稽核軌跡
  • 在結構化檢視中組織財務資料或績效指標
  • 為「資料表格」或「資料網格」建立元件庫標準

何時不應使用

  • 簡單的鍵值對: 如果只有兩欄(例如:標籤:值),請改用描述清單(<dl>)或簡單清單。
  • 敘述性內容: 長篇文字或故事應使用標準排版與章節結構,而非表格。
  • 版面網格: 頁面佈局請使用「響應式網格系統」;表格僅限於資料呈現。
  • 低資料量的卡片: 如果資料視覺化程度高且屬性很少,請使用「卡片 UI 系統」以獲得更好的互動效果。

輸入

  1. 資料結構: 要顯示的資料類型(字串、數字、日期、布林值、動作)。
  2. 欄位優先級: 哪些屬性是識別的主要關鍵,哪些是次要細節。
  3. 使用者任務: 使用者需要尋找特定行、跨行比較值,還是執行大量動作?
  4. 資料量預估: 典型檢視中預期有多少行與欄?

輸出

  1. 表格結構規格: 定義的區域(表頭、列、儲存格、表尾)及其內部間距。
  2. 對齊規則矩陣: 根據資料類型制定的水平對齊規則。
  3. 密度變體: 「緊湊」、「標準」與「寬鬆」行高的定義。
  4. 互動對應: 排序、篩選、選取行與內嵌動作的行為說明。

工作流程

1. 定義欄位類型與對齊

應用「對齊經驗法則」以確保可掃描性:

  • 文字(預設): 靠左對齊(幫助視線跟隨單詞的開頭)。
  • 數字/指標: 靠右對齊(對齊小數點,便於快速比較數值大小)。
  • 日期/狀態標籤: 置中或靠左對齊(視欄位寬度而定)。
  • 動作: 靠右對齊(通常是最後一欄)。

2. 建立視覺層級(表頭)

表格表頭必須與資料清楚區分:

  • 樣式: 使用不同的背景顏色、粗體或全大寫字體處理 <th> 元素。
  • 固定性: 對於長表格,使用固定表頭(sticky header),讓使用者在捲動時仍能保持上下文。

3. 設定行密度與節奏

根據使用案例選擇密度等級:

  • 緊湊: 高資料密度(例如 32px 高度)。最適合專業使用者與儀表板。
  • 標準: 平衡(例如 48px 高度)。最適合一般用途。
  • 寬鬆: 低密度(例如 64px 高度)。最適合行銷或簡單清單。 使用斑馬條紋或微妙的邊框來分隔行,減少「跳行」情況。

4. 設計互動式資料

定義使用者如何操作資料:

  • 排序: 在支援排序的表頭中加入指示器(例如上下箭頭)。
  • 行狀態: 定義行的「懸停」、「選取」與「聚焦」狀態。
  • 大量動作: 如果需要,在最左側加入核取方塊欄。

5. 規劃內容變異

處理資料長度的邊界情況:

  • 截斷: 對於非關鍵識別的長文字,使用省略號。
  • 換行: 對於重要的描述性文字,允許換行。
  • 固定寬度: 為穩定的欄位(例如狀態、日期)指定固定寬度,為主要識別欄位(例如名稱)使用流動寬度。

決策規則

  • 可掃描性規則: 第一欄應始終是最重要的識別欄位(例如名稱、ID),作為該行的錨點。
  • 數字對齊: 如果比較數值是主要任務,請為數字使用等寬字體,以保持數字完美對齊。
  • 斑馬條紋 vs. 邊框: 對於非常寬的表格,使用斑馬條紋幫助視線水平追蹤;對於較短、較簡單的表格,使用邊框。
  • 動作放置: 將動作集中在最後一欄,或使用可見的「更多」選單來保持介面整潔。
  • 空白儲存格: 絕不要讓儲存格留空。使用破折號(—)或「N/A」來確認資料缺失,而非載入錯誤。

限制條件

  • 無障礙性: 必須使用語意化的 <table> 標籤。表頭必須設定 scope="col"。必須使用 <caption> 提供上下文。固定表頭不得遮蓋捲動至其下方的儲存格或行動作的焦點指示器(WCAG 2.2 SC 2.4.11)。內嵌的動作按鈕/連結必須符合 24x24px 的最小目標尺寸(SC 2.5.8)。
  • 響應式: 當檢視埠縮小時,表格必須遵循「響應式資料表格」(捲動、堆疊或切換)的模式。
  • 對比度: 表頭文字與狀態指示器必須符合 WCAG AA(4.5:1)的對比度要求。

常見失敗模式

  • 數字未對齊: 將數字靠左對齊會導致無法一眼比較數值大小。
  • 「文字牆」: 使用高密度行卻沒有斑馬條紋或清楚的表頭區別,造成「視覺疲勞」。
  • 不明顯的表頭: 表頭與資料過於相似,難以知道各欄代表什麼。
  • 缺少動作提示: 儲存格內的按鈕或連結太小,難以點擊,或看起來不像可互動的元素。
  • 無空狀態: 顯示空白表格,卻沒有「找不到結果」的訊息。

驗證標準

  • 欄位對齊遵循資料類型規則(文字靠左,數字靠右)。
  • 表格表頭在視覺上與行資料有明顯區別。
  • 主要識別欄位固定在第一欄。
  • 使用語意化 HTML(<table>、<th>、scope)建立結構。
  • 空白儲存格使用佔位符號(例如 —),而非留空。
  • 已清楚定義互動狀態(懸停/選取)。
  • 設計能優雅處理長內容(截斷或換行)。
  • 固定表頭絕不遮蓋行或儲存格動作的焦點指示器(WCAG 2.2 SC 2.4.11)。
  • 行動作符合 24x24px 的最小目標尺寸(WCAG 2.2 SC 2.5.8)。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for progressive disclosure using accordions, ensuring structural integrity, visual affordances, and accessibility across different content densities and devices.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for long-form content, managing readability, vertical rhythm, and information density to ensure a superior reading experience.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for informational elements that communicate state (Badges) and categorization (Tags) with clarity and accessibility.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for non-overlay notifications, managing global announcements and contextual inline alerts to communicate system states without interrupting the user's flow.

coastdigitalgroup/coastai-skills

Design and implement a systematic, asymmetrical bento-grid layout framework to organize diverse content types cohesively while maintaining strict visual hierarchy, logical focus order, and responsive flexibility.

coastdigitalgroup/coastai-skills

Design a responsive, mobile-first bottom navigation bar and persistent action dock system for mobile websites and web applications, establishing spatial anchors, tab bar anatomy, badge indicators, thumb-zone ergonomics, safe area inset handling, active/inactive state contrast, and desktop responsive adaptation rules.

coastdigitalgroup/coastai-skills

Design a mobile-first bottom sheet overlay system with configurable detents, drag affordances, safe area padding, responsive desktop modal/popover adaptation, and WCAG AA accessibility compliance.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for secondary navigation trails that provide orientation, context, and one-click access to parent levels in deep information architectures.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for buttons and interactive triggers, managing visual hierarchy, variant logic, and action grouping to ensure clear intent and accessible interaction.

coastdigitalgroup/coastai-skills

Design a systematic framework for date and time selection, managing calendar grids, range pickers, and scheduling interfaces to ensure precision and accessibility.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for modular content containers that maintain hierarchy, structural integrity, and action alignment across variable content and responsive viewports.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for horizontal discovery components, managing navigation affordances, scroll behavior, and accessibility to ensure effective content density without compromising usability.

coastdigitalgroup/coastai-skills

Design a systematic, highly accessible, and developer-friendly UI layout framework for code blocks, snippet showcases, multi-file code tabs, line-highlighting, diff views, and syntax token contrast in technical documentation and developer platforms.

coastdigitalgroup/coastai-skills

Design a systematic framework for global command menus (Cmd+K panels) that combines keyboard-driven navigation, command execution, and shortcut discovery into an accessible, responsive overlay.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for threaded conversations, managing nesting depths, action hierarchies, and community signaling to foster engagement and readability.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for side-by-side comparison interfaces, managing high attribute density and responsive complexity to support informed decision-making.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for user privacy, managing consent banners, preference centers, and persistent privacy controls to balance legal compliance with user trust.

coastdigitalgroup/coastai-skills

Design and implement a systematic, highly accessible, and responsive visual layout framework for conversational chat widgets, live chat boxes, and chatbot panels that ensures clear message scannability, native focus flow, and seamless mobile keyboard adaptation.

coastdigitalgroup/coastai-skills

Design a systematic, accessible, and high-conversion framework for custom select dropdowns and comboboxes, defining anatomy, states, search-filtering, and responsive mobile-adaptive patterns.

coastdigitalgroup/coastai-skills

Design and implement a systematic color palette that ensures WCAG 2.2 accessibility compliance. Trigger this skill when asked to define brand colors, create UI themes, or establish a visual system for a website.

相關技能