Skip to content

Table Widget

Introduction

The Table Widget is a core component designed to present structured data in a clear, interactive, and customizable format. It transforms raw datasets into organized tables that can be sorted, filtered, styled, and extended with scripts—making it easier to explore data, compare records, and perform quick analysis.


Purpose

To visualize structured data in a flexible tabular layout with column-level formatting, conditional logic, and advanced features like filtering, pagination, and scripting.

Key Features

Data Display

Structured layout with responsive design; handles thousands of records efficiently.

Sorting

Single or multi-column sorting (ascending/descending)

Filtering

Column-level filters with multi-condition support.

Custom Columns

Create calculated fields, add HTML/JS for dynamic content (badges, icons, buttons).

Conditional Formatting

Apply row/cell styles (colors, icons, font rules) based on logic.

Pagination

Page navigation, configurable rows per page, jump-to-page support.

Column & Header Styling

Control alignment, width, font, colors, and borders.

Performance Options

Virtualization and heavy data processing for large datasets.

Steps to Create a Table Widget

  1. From the left vertical menu, click the Table Widget icon.

    Table Widget

  2. A new screen will appear to configure the widget.

    Table Widget

  3. Select a dataset from the Datasets dropdown.

  4. Columns from the dataset appear in Available Columns.

  5. Drag and drop columns into the Columns section.

Configuring the Widget

Dataset & Client Script

  1. Select Dataset: Choose a dataset (e.g., sales.ds or swiggy.ds).

  2. Optional Filter Logic (Client Script): Apply SQL-like filters before rendering.

    Example:

    SELECT * FROM ? WHERE “Category” = ‘Non-Veg’

    This filters the dataset before it reaches the table.

    Table Widget

    --- link to client script

Add Columns

  • Drag columns (e.g., Restaurant Name, Cuisines, Average Price, Category) into the widget.

  • You can add calculated or styled columns to enrich your dataset table.

Steps to Create a Custom Column

  1. Click the ➕ icon next to Columns.

    Table Widget

  2. Enter a Column Name -> This is the label that will appear in your table (e.g., Food Item Category).

  3. Set a Rule

    • Column -> The dataset field you want to check (e.g., Category).

    • Condition -> Logic applied to that column (e.g., Is Not Null, Equals, Greater Than, etc.).

    • Value -> The value to compare against (leave empty if not needed, e.g., for Is Not Null).

  4. Add Rendering Code (JavaScript) to style the output dynamically.

  5. Click Create Column -> The formatted column appears in your table.

Example: Veg/Non-Veg Indicator

  • Column Name -> Food Item Category

  • Column -> Category

  • Condition -> Is Not Null

  • Value -> (leave blank)

if ("{{Category}}" === "Veg") {
  return '<div style="display: inline-flex; align-items: center;">' +
         '<div style="width: 12px; height: 12px; border-radius: 50%; background-color: green; margin-right: 6px;"></div>' +
         '<span>{{Category}}</span></div>';
} else if ("{{Category}}" === "Non-Veg") {
  return '<div style="display: inline-flex; align-items: center;">' +
         '<div style="width: 12px; height: 12px; border-radius: 50%; background-color: red; margin-right: 6px;"></div>' +
         '<span>{{Category}}</span></div>';
} else {
  return '<div>{{Category}}</div>';
}

Table Widget

Output

Table Widget

Column Settings

Click the Create icon icon next to any column to open its settings:

SettingDescription
Column NameRename display name
Content AlignAlign column data: Left, Center, Right
WidthAdjust column width in pixels

Header Settings

You can customize headers for each column individually by clicking the Create icon icon next to the column name inside the Table Widget -> Columns section.

SettingDescription
Header AlignAlign the text in the header (Left, Center, or Right).
Text ColorSet the header font color using HEX code or color picker.
Background ColorSet the background color of the column header.
Font SizeAdjust the font size of the header text (e.g., 12px, 16px).
Font WeightChoose from Normal, Bold, or other weight levels.
Font StylePick between Normal, Italic, etc., for header text style.

These settings allow for per-column header formatting — useful for highlighting key fields (e.g., metric columns in bold or different background colors).

Format Value

Format the display of data within the cells of this column. This is especially useful for numeric values.

SettingDescriptionExample
Decimal PlacesSpecify the number of decimal points to display.2 formats 150 as 150.00.
Before SymbolAdd a prefix symbol or text before the value.$ formats 150 as $150.
After SymbolAdd a suffix symbol or text after the value. kg formats 150 as 150 kg.
Thousands SeparatorEnable to display a comma as a thousands separator.Formats 1000000 as 1,000,000.
PercentFormat the value as a percentage (multiplies by 100 and adds %).Formats 0.95 as 95%.

How to Use

  1. Click on the Create icon icon next to the desired column in the Table Widget -> Columns section.
  2. In the pop-up panel, expand the Header Settings section.
  3. Apply your header text formatting, including alignment, color, background color, size, weight, and style.
  4. Click outside the panel or press Enter to apply changes.

Example: To make the header of the Restaurant Name column appear distinct, set Font Weight: Bold, Text Color: #000000, and Background Color: #e0e0e0.

Table Widget

Table Settings

Expand the Table Settings panel to configure table-wide features:

OptionDescription
SortingEnable/disable column sorting
MultisortingAllow sorting by multiple columns
FilteringEnable column filter dropdowns
Show Column MenuShow additional column-level options
Hide ScrollbarHides the vertical scrollbar, useful with pagination.
VirtualizationImprove performance for large datasets
PaginationPaginate rows for cleaner display
Records per PageSet number of rows per page (e.g., 10, 25, 50). This option is applicable only when Pagination is enabled.
Text WrapWrap cell content for long text
Wrap ModeOptions: Both, Header, Value
Grid LinesControl gridline visibility:
None -> No gridlines
Default -> System default style
Horizontal -> Show only row separators
Vertical -> Show only column separators
Both -> Show both row & column separators
Conditional Formatting (Row)Click the f(x) icon to define styling rules
Row HeightSet height (in px) of each row (default: 25)

Steps to Apply Conditional Formatting

  1. Enable Conditional Formatting

    • Go to Table Settings -> click f(x) Conditional Formatting (Row).

    • Toggle Enable Conditional Formatting -> ON.

  2. Add a Formatting Level

    • Click Add Level to create a new formatting rule.
  3. Configure Formatting Options

    • Set Name, Background Color, Text Color, Font Size, Font Weight, and Font Style.

    • Each level can include multiple rules.

Example : Highlight Veg Restaurants

FieldValue
NameVeg Restaurants
Background Color#59d97d (green)
Text Color#ffffff
Font WeightBold
RuleColumn: Veg/Non-Veg -> Condition: Equals -> Value: Veg

Table Widget

  • Each level can include multiple rules.

  • Click Save to apply changes.


Publishing

After customizing the widget:

  • Click the Publish button (top-right).
  • The table widget will appear on your dashboard canvas.

Header Settings

FieldDescription
Hide HeaderCompletely hides the header row of the table.
NameOptional label for the level (e.g., High Performance)
Background ColorSet cell background (e.g., #59d97d)
Text ColorText color (e.g., #ffffff)
Font SizeEnter font size (e.g., 12)
Font WeightChoose from Normal, Bold, etc.
Font StyleChoose from Normal, Italic, etc.
Header Column Border ColorSet the color of the border around the header cell.

Body Settings

These settings control the appearance of the table’s body, including row styling and pagination controls.

SettingDescription
Body Background ColorSets the overall background color for the table body (e.g., #ffffff).
Body Font SizeDefines the font size for the data within the table cells (e.g., 12 px).
Row Border ColorSets the color of horizontal lines between rows (e.g., #e5e5e5).
Column Border ColorSets the color of vertical lines between columns (e.g., #e5e5e5).
Even Row Background ColorBackground color for even-numbered rows for zebra striping (e.g., #f9f9f9).
Even Row Font ColorText color for even-numbered rows (e.g., #333333).
Odd Row Background ColorBackground color for odd-numbered rows (e.g., #ffffff).
Odd Row Font ColorText color for odd-numbered rows (e.g., #333333).
Pagination Active Background ColorBackground color for the currently active page number (e.g., #000000).
Pagination Active Font ColorText color for the active page number (e.g., #ffffff).
Pagination Background ColorBackground color for the pagination control area (e.g., transparent).
Pagination Font ColorText color for inactive page numbers (e.g., #333333).

Use Cases

Use CaseAudienceFeatures UsedBenefit
Data ExplorationAnalysts, Power UsersSorting, Filtering, PaginationExplore and analyze large datasets.
Operational MonitoringSupport, OperationsConditional Formatting, Custom ColumnsQuickly spot trends and issues.
Financial ReportingFinance, AccountsColumn Formatting, Header StylingClean, professional tables.
CRM and Sales ManagementSales TeamsFiltering, Sorting, Action ButtonsLightweight CRM in a table.
Product Catalog & InventoryE-commerce, LogisticsFiltering, Text Wrap, PaginationManage stock or product listings easily.

Example: Real-time Order Monitoring

Goal

Let an operations manager track real-time orders and highlight:

  • Pending orders (yellow background)
  • High-value orders (green and bold)

Sample Data

OrderIDCustomerStatusValue
1001John SmithShipped150.00
1002Jane DoePending2500.00
1003Acme CorpShipped75.50
1004Peter JonesPending800.00
1005Global IncDelivered5000.00

Steps

  1. Add Table Widget and connect to Orders dataset.

  2. Drag columns into the widget.

  3. Enable Sorting, Filtering, and Pagination.

  4. Apply Conditional Formatting:

    • Level 1: Status = Pending → Light Yellow (#FFF3CD)

    • Level 2: OrderValue > 1000 → Light Green (#D4EDDA), Bold

      Table Widget

  5. Customize header styles and publish.

The result is a real-time dashboard view with visual cues for priority processing.


Summary

The Table Widget is essential for displaying structured data with full control over styling, formatting, filtering, and behavior. Whether for analytics, operations, finance, or CRM, it’s your go-to tool for data visibility inside VIZ.