API 參考
Table
呈現精確查閱數值或結構化比較。
presentation.tsx
<Table id="owners" x={9} y={28} w={82} h={48} cells="市場|訊號|負責人;北區|上升|Ava" fontSize={12} />屬性參考
屬性值應保持字面且可序列化,才能由 Canvas、Inspector、驗證與匯出流程可靠處理。
| API | 屬性 | 型別/值 | 必要 | 說明 |
|---|---|---|---|---|
| 所有原生圖層共用 props | id | string | 是 | 穩定且唯一的圖層識別字。每個可見的原生圖層都必須提供。 |
| x | number | 是 | 相對於投影片畫布左側的位置百分比。 | |
| y | number | 是 | 相對於投影片畫布頂端的位置百分比。 | |
| w | number | 是 | 圖層寬度,單位為畫布百分比。 | |
| h | number | 是 | 圖層高度,單位為畫布百分比。 | |
| groupId | string | — | 在不加入 wrapper 元素的情況下,將原生子圖層編組。 | |
| groupName | string | — | 在 Workbench 顯示的群組名稱。 | |
| sharedId | string | — | 連接相鄰 Morph 投影片中的同型圖層;在同一張投影片內必須唯一。 | |
| rotation | number | — | 順時針旋轉角度。 | |
| opacity | number | — | 圖層不透明度,範圍為 0 到 1。 | |
| motion | JSON string | — | 版本化的宣告式動作序列 JSON 字串;仍須保留完整的靜態最終畫面。 | |
| interaction | JSON string | — | 版本化的點擊互動 JSON 字串,可用於投影片導覽或連結。 | |
| Table | cells | string | 是 | 儲存格資料:直線分隔欄、分號分隔列。 |
| rows | number | — | 列數,範圍為 1 到 50。 | |
| columns / cols | number | — | 欄數,範圍為 1 到 50。 | |
| columnLabels / rowLabels | string | — | 序列化的欄或列標籤。 | |
| columnWidths / rowHeights | string | — | 序列化的比例軌道尺寸。 | |
| cellOverrides | JSON string | — | 由 Workbench 建立的逐格視覺覆寫。 | |
| fontFamily / fontSize / fontWeight | string | number | — | 表格字體樣式;fontSize 單位為 point。 | |
| color / textColor | color string | — | 表格文字顏色。 | |
| background / backgroundColor / bg | color string | — | 表格背景顏色。 | |
| cellBackground / stripeBackground | color string | — | 儲存格底色與交錯列底色。 | |
| borderColor / borderWidth / borderStyle | color | number | solid | dashed | dotted | — | 表格邊框樣式。 | |
| textAlign / textVerticalAlign | left | center | right / top | middle | bottom | — | 儲存格對齊。 | |
| cellPaddingX / cellPaddingY | number | — | 儲存格水平與垂直內距,單位為像素。 |
必要語法
使用 id、x、y、w、h 與 cells;cells 用直線分隔欄位,用分號分隔列。
格式設定
需要時可使用 rows、columns、fontSize、fontWeight、background、cellBackground、stripeBackground、borderColor 與 borderWidth。Table 適合用在使用者必須精確檢查的數值。