Table Layer

Table layers bring structured, grid-based data organization to Component.Studio. Perfect for stat blocks, item lists, ability tables, scoreboards, and any design that needs organized rows and columns of information, table layers combine the power of spreadsheet-like organization with the visual flexibility of Component.Studio's design system. With intelligent sizing, customizable borders, cell backgrounds, and full integration with template variables, tables transform complex data into clear, readable layouts.

Understanding Table Structure

Tables are grids of cells organized in rows and columns. Think of them like mini spreadsheets embedded in your design. Each cell can contain text (including template variables and inline icons), and you have precise control over how the table divides its space among rows and columns.

Cell Naming: Cells are named using spreadsheet notation - column letters (A-J) followed by row numbers (1-10). Cell A1 is the top-left corner. Cell C2 is column C, row 2. This makes it easy to reference specific cells in formulas and advanced features.

Position and Size

Tables use standard layer positioning, but their internal structure is where things get interesting.

Property Description
X Position Horizontal position in pixels from the origin point
Y Position Vertical position in pixels from the origin point
Width Total width of the entire table in pixels
Height Total height of the entire table in pixels
Rotation Rotation angle in degrees (0-360)
Anchor The reference point for positioning (top-left, center, etc.)

Table Cells

The Table Cells section is where you define your table's grid structure and populate it with content.

Grid Dimensions

Property Range Description
Columns 1-10 Number of columns in the table. Columns are lettered A, B, C, etc.
Rows 1-10 Number of rows in the table. Rows are numbered 1, 2, 3, etc.

Table Size Examples

  • 2 columns × 3 rows: Simple two-column list (like Label | Value)
  • 4 columns × 5 rows: Moderate stat table with headers
  • 1 column × 8 rows: Single-column list or menu
  • 5 columns × 5 rows: Square grid perfect for game boards or ability matrices

Column Sizing

Property Options Description
Column Sizing Equal or Manual How to distribute width among columns. "Equal" divides width evenly; "Manual" uses Column Widths.
Column Widths Comma-separated list Width in pixels for each column (when Column Sizing is "Manual"). Use 0 for flexible columns that share remaining space equally.

Understanding Column Widths

Column Widths is a comma-separated list where each number represents a column's width in pixels, in order from left to right.

Example 1: Column Widths: 150,0,100 on a 400px wide table with 3 columns

  • Column A: 150px (fixed)
  • Column B: 150px (calculated: 400 - 150 - 100 = 150 remaining, and one "0" column takes it all)
  • Column C: 100px (fixed)

Example 2: Column Widths: 100,0,0 on a 400px wide table with 3 columns

  • Column A: 100px (fixed)
  • Column B: 150px (calculated: 300px remaining ÷ 2 flexible columns = 150px each)
  • Column C: 150px (calculated: same as B)

Example 3: Column Widths: 0 on any table

  • All columns share the full width equally (same as Column Sizing: "Equal")
Width Validation: The sum of fixed widths (non-zero values) cannot exceed the table width. If your fixed columns total more than the table width, you'll get an error. Make sure there's room for at least some flexible space, or use all fixed values that sum to exactly your table width.

Row Sizing

Property Options Description
Row Sizing Equal or Manual How to distribute height among rows. "Equal" divides height evenly; "Manual" uses Row Heights.
Row Heights Comma-separated list Height in pixels for each row (when Row Sizing is "Manual"). Use 0 for flexible rows that share remaining space equally.

Common Row Height Patterns

  • Header + Data: 40,0,0,0 - Fixed 40px header row, remaining rows share the rest equally
  • Footer emphasis: 0,0,0,60 - Last row is fixed 60px, earlier rows are flexible
  • Alternating sizes: 30,50,30,50 - Specific height for visual rhythm
  • All flexible: 0 - All rows equal height (same as Row Sizing: "Equal")

Cell Content Grid

The Table Cells section displays a visual grid of all your cells. Click any cell to open an editor where you can enter content. Each cell is a text field that supports:

  • Plain text: Type directly into cells
  • Template variables: Use {{row.variableName}} to pull data from your dataset
  • Inline markup: Use styles like <bold>bold</bold> for emphasis
  • Inline icons: Insert <icon/> to embed images inline with text
  • Formulas and calculations: Any expression that works in text layers works in table cells
Click to Edit: Simply click any cell in the grid preview to open the field drawer and edit that cell's content. The cell name (like "B3") appears in the editor so you always know which cell you're editing.

Quick Fill for Rows

The Quick Fill feature provides a fast way to populate an entire row at once. Click the three dots next to any row to open the Quick Fill dialog.

Using Quick Fill

Quick Fill accepts comma-separated values that fill the row from left to right:

Input: Name,{{characterName}},Level,{{level}}

Result in a 4-column table:

  • Column A: "Name"
  • Column B: (whatever {{characterName}} resolves to)
  • Column C: "Level"
  • Column D: (whatever {{level}} resolves to)

Skipping Cells: Leave values blank between commas to skip cells

Input: First,,Third, (note the double comma and trailing comma)

  • Column A: "First"
  • Column B: (empty)
  • Column C: "Third"
  • Column D: (empty)
Quick Fill Limitations: Extra values beyond your column count are ignored. Missing values (fewer commas than columns) leave those cells empty, which deletes any existing content in those cells. Quick Fill is all-or-nothing for a row.

Reordering Columns and Rows

You can reorganize your table by dragging column headers or using row movement controls. This moves the cell content, not just visual layout.

  • Drag columns: Click and drag column letter headers (A, B, C) to reorder columns left-to-right
  • Move rows: Click the arrow icons next to row numbers to shift row content up or down
  • Content moves, not labels: The column letters and row numbers stay in place - it's the cell values that relocate
Reorganization Freedom: Found out your label column should be on the right instead of left? Drag it. Need to move the header row to the bottom? Use row controls. Rearranging table content is quick and visual, with no need to manually copy-paste cell values.

Table Formatting

Table formatting controls the visual presentation: spacing, colors, borders, and separators that define the table's appearance.

Cell Spacing

Property Range Description
Cell Margin 0-100px Space around the outside of each cell. Creates gaps between cells. This space is NOT considered part of the cell.
Cell Padding 0-100px Space between cell edges and cell content. Creates breathing room inside cells. This space IS part of the cell (affected by background color).

Margin vs Padding

Understanding the difference is crucial for visual design:

Cell Padding (default: 10px):

  • Pushes text away from cell edges
  • Included in cell background color
  • Makes text more readable within cells
  • Higher padding = more spacious cells

Cell Margin (default: 0px):

  • Creates gaps between cells
  • NOT included in cell background color (gaps show the layer behind)
  • Separates cells visually without using borders
  • Higher margin = more distinct, separated cells

Typical Combinations:

  • Padding: 10, Margin: 0 = Tight table with cells touching
  • Padding: 15, Margin: 5 = Spacious cells with visible gaps
  • Padding: 5, Margin: 0 = Compact, dense data table

Cell Backgrounds

Property Range Description
Color Cells true/false Enable or disable cell background colors. When false, cells are transparent.
Cell Background Color Hex color The color applied to all cell backgrounds (when Color Cells is enabled)
Cell Background Opacity 0-100% Transparency of cell backgrounds. 0 = invisible, 100 = fully opaque
Per-Cell Backgrounds: The basic table layer applies the same background to all cells. For more complex designs with different colors per cell, per-row, or per-column, use the Advanced Cells feature to overlay colored box layers on specific cells.

Borders and Separators

Property Range/Type Description
Stroke Width 0-20px Thickness of all borders and separators. Applies to whatever border types you've enabled.
Stroke Color Hex color Color of all borders and separators
Draw Row Separators true/false Draw horizontal lines between rows
Draw Column Separators true/false Draw vertical lines between columns
Draw Table Border true/false Draw a border around the entire table perimeter
Draw Table Cell Borders true/false Draw borders around each individual cell

Common Border Patterns

Full Grid (default):

  • Row Separators: true
  • Column Separators: true
  • Table Border: true
  • Cell Borders: false
  • Result: Classic spreadsheet look with all grid lines visible

Minimal Rows Only:

  • Row Separators: true
  • Column Separators: false
  • Table Border: false
  • Cell Borders: false
  • Result: Horizontal lines separating rows, clean horizontal reading flow

Outlined Cells:

  • Row Separators: false
  • Column Separators: false
  • Table Border: true
  • Cell Borders: true
  • Result: Each cell clearly outlined, almost like individual boxes

Borderless:

  • All border options: false
  • Result: Pure spacing-based layout, modern and clean

Text Formatting

Table layers share all the text formatting properties of text layers. These settings apply to all text within the table cells.

Property Description
Styles Comma-separated style names to apply to all cell text
Font Name Typeface for all cell text (or -inherit- to use style)
Font Size Text size in pixels for all cells (or -inherit-)
Color Text color for all cells (or -inherit-)
Horizontal Alignment left, center, right, or justify for all cells
Vertical Alignment top, middle, or bottom for all cells
Letter Spacing Extra spacing between letters
Line Spacing Extra spacing between lines when text wraps in cells
Paragraph Spacing Extra spacing between paragraphs in cells
Icon Scale Size of inline icons relative to text (percentage)
Fit To Size Automatically shrink text that's too large to fit in cells
Alignment Tip: Center horizontal alignment works well for most tables. For data-heavy tables with numbers, try right alignment. For text-heavy narrative tables, left alignment often reads better.
Uniform Formatting: Basic table formatting applies uniformly to all cells. If you need different fonts, colors, or alignments in different cells, use the Advanced Cells feature to overlay custom text layers on specific cells.

Advanced Cells

Advanced Cells is a powerful feature that lets you overlay any layer type on top of specific table cells. This enables complex designs where different cells have different backgrounds, custom text formatting, images, or even nested layers.

How Advanced Cells Work

When you enable advanced cells for a specific cell, you can attach a layer to that cell. The layer automatically positions and sizes itself to match the cell's dimensions, and moves with the cell if you reorganize the table.

Advanced Cell Use Cases

  • Header row backgrounds: Overlay colored box layers on row 1 cells to create distinct header backgrounds
  • Per-cell text styling: Overlay custom text layers to have different fonts/colors in different cells
  • Icon cells: Place image layers in specific cells for visual indicators
  • Conditional coloring: Use template variables to show different colored boxes based on data values
  • Complex cell content: Build elaborate cell interiors with multiple layered elements

Table Functions

Table functions are special template functions that let you reference table cell dimensions and positions. These are primarily used with Advanced Cells but can be used anywhere in your design.

Function Returns Example
cellLeft(cell, excludePadding) X position of cell's left edge cellLeft('MyTable:B2', true)
cellRight(cell, excludePadding) X position of cell's right edge cellRight('MyTable:B2', true)
cellTop(cell, excludePadding) Y position of cell's top edge cellTop('MyTable:B2', true)
cellBottom(cell, excludePadding) Y position of cell's bottom edge cellBottom('MyTable:B2', true)
cellWidth(cell, excludePadding) Width of the cell cellWidth('MyTable:B2', true)
cellHeight(cell, excludePadding) Height of the cell cellHeight('MyTable:B2', true)
cellValue(cell, field) Value of a cell field cellValue('MyTable:B2', 'value')

Cell Reference Format

Cell references use the format: 'TableLayerName:CellName'

  • 'StatsTable:A1' - Cell A1 in the layer named "StatsTable"
  • 'ItemList:C4' - Cell C4 in the layer named "ItemList"

excludePadding parameter:

  • true - Returns dimensions excluding cell padding (content area only)
  • false - Returns dimensions including cell padding (full cell area)

Using Table Functions with Advanced Cells

When you overlay a layer on a cell using Advanced Cells, you typically use table functions to position and size it:

  • X: {{cellLeft('MyTable:B2', true)}}
  • Y: {{cellTop('MyTable:B2', true)}}
  • Width: {{cellWidth('MyTable:B2', true)}}
  • Height: {{cellHeight('MyTable:B2', true)}}

This ensures the overlaid layer perfectly matches the cell boundaries and updates automatically if you change table dimensions or cell sizing.

Working with Table Layers

Common Use Cases

Stat Block

Create a character or item stat display:

  • 2 columns (Label | Value)
  • Column Widths: 120,0 (fixed label width, flexible value width)
  • Row Sizing: Equal
  • Content: "Strength | {{strength}}", "Dexterity | {{dexterity}}", etc.
  • Borders: Row separators only for clean horizontal divisions

Ability Table

Display abilities or features with descriptions:

  • 3 columns (Icon | Name | Description)
  • Column Widths: 40,100,0 (small icon column, medium name, flexible description)
  • First column: Advanced cells with image layers for ability icons
  • Second column: {{abilityName}}
  • Third column: {{abilityDescription}}

Item Inventory List

List items with quantities:

  • 3 columns (Quantity | Item | Cost)
  • All columns equal width or manual: 60,0,80
  • Use template variables: {{quantity}}, {{itemName}}, {{cost}}
  • Right-align the Quantity and Cost columns for number readability

Design Tips

  • Start with equal sizing: Use equal column and row sizing initially, then switch to manual only when you need specific proportions
  • Use 0 for flexibility: In manual sizing, use 0 for columns/rows that should adapt to available space
  • Padding for readability: Cell padding of 8-15px usually creates readable tables without wasting too much space
  • Consider alignment: Numbers often look better right-aligned, labels left-aligned, and titles center-aligned
  • Leverage styles: Define a "table-header" and "table-body" style for consistent table formatting across your game
  • Border minimalism: Sometimes fewer borders create cleaner designs - try row separators only
  • Advanced cells for headers: Use Advanced Cells to give header rows colored backgrounds that distinguish them from data rows

Performance Considerations

Tables are rendered efficiently, with text caching for cells. However, very large tables (approaching 10×10) with complex cell content can impact rendering speed. For optimal performance:

  • Keep tables to the size you actually need (don't create 10×10 if you only use 4×6)
  • Minimize use of advanced cells where possible - they add layer complexity
  • Simple text content renders faster than cells with many inline icons or complex markup

Troubleshooting

My column widths don't work

  • Check that Column Sizing is set to "Manual" (not "Equal")
  • Verify your Column Widths list has values for each column (or at least one value)
  • Ensure fixed widths don't sum to more than your table width
  • Remember: 0 means "flexible" not "zero pixels"
  • Check for typos or non-numeric values in the comma-separated list

Text is cut off or overflowing cells

  • Increase Cell Padding to give text more room
  • Make columns wider (increase table width or adjust Column Widths)
  • Reduce font size or enable Fit To Size to auto-shrink text
  • Check if long words are forcing overflow - consider shorter content or text wrapping
  • Verify vertical alignment isn't pushing text out of view

I can't see cell backgrounds

  • Ensure "Color Cells" is enabled (true)
  • Check that Cell Background Opacity isn't set to 0
  • Verify Cell Background Color isn't the same as your background
  • Cell Margin creates gaps where background won't show - that's normal

Borders are missing or look wrong

  • Check that the appropriate Draw options are enabled (Row Separators, Column Separators, etc.)
  • Verify Stroke Width isn't 0
  • Ensure Stroke Color isn't transparent or matching your background
  • If borders overlap strangely, it's because multiple border types are enabled - disable some for cleaner results

Quick Fill isn't working as expected

  • Remember to include commas for every column, even if skipping cells (use double commas: ,,)
  • Trailing commas create empty cells at the end
  • Extra values beyond your column count are silently ignored
  • Quick Fill replaces all specified cells - it doesn't merge with existing content

Advanced Cell layer isn't positioned correctly

  • Verify you're using the correct table function syntax: cellLeft('TableName:CellName', true)
  • Check that table layer name matches exactly (case-sensitive)
  • Ensure cell reference uses correct column letter and row number (like 'B2', not 'B02' or '2B')
  • Try excludePadding = true for most layouts (positions within content area, not including padding)
  • Make sure the overlaid layer's anchor point is set to top-left for predictable positioning

Table functions return errors

  • Check table layer name spelling and case
  • Verify cell reference format: 'LayerName:A1' with quotes
  • Ensure the cell exists (column letter and row number are within your table dimensions)
  • Table functions only work after the table layer is created - you can't reference tables that don't exist yet

Table layers bring order to complex data, transforming rows and columns of information into clear, readable layouts. Master sizing for perfect proportions, leverage borders and backgrounds for visual structure, use template variables for dynamic data, and explore Advanced Cells for sophisticated designs. With tables, organized data becomes organized design!

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us