VirtualTable
ic.VirtualTable is the virtualized counterpart of ic.Table, designed for datasets with tens or hundreds of thousands of rows. It shares the same column definitions, events, and features (sorting, filtering, selection, inline editing, pinned columns), but only renders the rows currently visible in the viewport. Data stays in MATLAB and is fetched on demand as the user scrolls, so the frontend never holds the full dataset in memory.
For column types, configuration options, color rules, and general table features, see the Table documentation. Everything described there applies to VirtualTable as well.
How it works
Unlike Table (which sends all data to the frontend), VirtualTable keeps the Data property on the MATLAB side and exposes a request handler. When the user scrolls, the frontend requests the visible slice plus a buffer, and MATLAB responds with just those rows. Sorting and filtering also happen in MATLAB: when a sort or filter changes, MATLAB recomputes an internal index array and updates the rows in the view.
This makes VirtualTable suitable for large datasets where sending everything to the browser would be slow or impractical.
Basic usage
% Create a large dataset
n = 100000;
data = table( ...
(1:n)', ...
"Sensor " + string(randi(50, n, 1)), ...
randn(n, 1) * 10 + 25, ...
randi([0 100], n, 1), ...
'VariableNames', {'ID','Sensor','Temperature','Humidity'});
cols = [
ic.table.NumberColumn("ID", Width=60, Pinned="left")
ic.table.TextColumn("Sensor", Sortable=true, Filterable=true)
ic.table.NumberColumn("Temperature", Sortable=true, ...
Filterable=true, Decimals=1, Suffix=" C")
ic.table.NumberColumn("Humidity", Sortable=true, ...
Filterable=true, Suffix="%")
];
vt = ic.VirtualTable("Data", data, "Columns", cols);
vt.Height = "400";
vt.Striped = true; The key difference from Table: you do not need to worry about data size or sending big chunks to the view. The Height property is important here since VirtualTable needs a fixed viewport to calculate which rows are visible. Row heights are fixed per size level (sm: 24px, md: 28px, lg: 36px) to enable fast scroll position calculations.
Server-side sorting and filtering
When columns have Sortable or Filterable set, the UI controls work identically to Table. The difference is that sorting and filtering happen in MATLAB, not in the browser. MATLAB rebuilds a sorted and filtered index array, then tells the frontend how many rows are in the current view. The frontend only fetches what it needs.
% Sorting and filtering happen server-side (in MATLAB)
% The frontend sends sort/filter changes to MATLAB,
% which recomputes the view and increments ViewVersion.
% The frontend then re-fetches only the visible rows.
addlistener(vt, "SortChanged", @(~, evt) ...
fprintf("Sort: %s %s\n", evt.Data.field, evt.Data.direction));
addlistener(vt, "FilterChanged", @(~, evt) ...
fprintf("Filter on %s\n", evt.Data.field)); Inline editing
Inline editing works the same way as in Table. Set Editable = true on the columns you want to be editable, and listen for the CellEdited event. VirtualTable updates the underlying MATLAB data and recomputes the view if the edit affects sorting or filtering.
% Inline editing works the same as Table.
% Set Editable=true on columns that should be editable.
cols = [
ic.table.TextColumn("Name", Editable=true)
ic.table.NumberColumn("Value", Editable=true, Decimals=2)
];
vt = ic.VirtualTable("Data", data, "Columns", cols);
addlistener(vt, "CellEdited", @(~, evt) ...
fprintf("Edited [%d, %s]\n", evt.Data.rowIndex, evt.Data.field)); Other methods
VirtualTable supports the same navigation methods as Table (clearSelection, scrollToRow, focusCell), plus data manipulation methods (removeRow, removeColumn, editCell) and refresh to force a view recomputation.
% Programmatic data manipulation
vt.removeRow(5); % remove row 5
vt.removeColumn("Humidity"); % remove a column
vt.editCell(3, "Sensor", "Sensor 99"); % update a cell
vt.refresh(); % force view recomputation
% Navigation
vt.scrollToRow("500"); % scroll to row 500
vt.focusCell(10, "Temperature"); % focus a specific cell
vt.clearSelection();