

Tabular
Details


- Tabular is also known as data frame, table and structured data.
- Tabular is typically used for data where each column can be thought of as a variable and each row as a measurement. Typically, only a window of data is displayed.
- Each column has an element type, such as number, string, date or expression. Data entries can be missing.
- Possible forms of data include:
-
{row1,row2,…} matrix as a list of rows » {assoc1,assoc2,…} list of associations with common keys » SparseArray[…],QuantityArray[…],… special matrix representations » Dataset[…] rectangular dataset » - Use ToTabular to convert more types of expressions to Tabular as well as have detailed control over how the conversion is done.
- Tabular[data,schm] sets or modifies the schema of the tabular data, where schm is given as a TabularSchema object or an association <|"prop1"val1,…|>.
- SQL-backed tabular objects can be created using the following forms for spec in Tabular[spec]:
-
RelationalDatabase[…] relational database object containing a single table RelationalDatabase[…]"table" select a table from a relational database <|"RelationalDatabase"RelationalDatabase[…],"Query""table"|> extended specification of a table from a database - Tabular can recognize and operate with missing or exceptional values, such as Missing[], Null, Infinity, etc.
- The data elements can be extracted using Part, Select, etc.
- Tabular can be converted to other forms using FromTabular or Normal.
- Tabular works with transformation functions such as TransformColumns and AggregateRows.
- Tabular[tabular,options] applies the given options to a Tabular object.
- The following options control the overall appearance of Tabular:
-
AllowedDimensions Automatic restrictions on the number of rows or columns AppearanceElements Automatic elements to include in the displayed view BaselinePosition Automatic what to align with a surrounding text baseline BaseStyle {} base style specifications for the tabular ImageMargins Automatic margins around the displayed tabular ImageSize Automatic the overall size of the table view Scrollbars {Automatic,Automatic} whether to include scrollbars ScrollPosition Automatic scroll position if scrolling is enabled - Possible elements in AppearanceElements include "RowHeaders", "CollapsedRowHeaders", "ColumnHeaders", "CollapsedColumnHeaders", "Frame" and "ResizeArea".
- Tabular takes the following options that determine the appearance of the tabular content:
-
Alignment Automatic horizontal and vertical alignment of items Background None what background colors to use Dividers Automatic whether to include dividers between cells HeaderAlignment Automatic horizontal and vertical alignments of headers HeaderBackground Automatic background colors to use for headers HeaderSize Automatic width and height of headers HeaderStyle Automatic styles to use for headers ItemDisplayFunction None function to use to format items ItemSize Automatic width and height of each item ItemStyle {} styles for columns and rows - The content options take the form opt<|"elem"spec,…|>, where "elem" specifies which elements the spec is affecting.
- Possible elements are:
-
"Columns"{s1,s2,…} style columns by position "Rows"{s1,s2,…} style rows by position "ColumnRules"{col1s1,…} style columns by keys "RowRules"{row1s1,…} style rows by index "ItemRules"{{row1,col1}s1,…} style items by row and column "ColumnValueFunction"cf style columns by values "RowValueFunction"rf style rows by values "ItemValueFunction"if style items by value - "Columns" and "Rows" take the following forms:
-
{s1,s2,…,sn} use s1 through sn, then use defaults s use s in all cases Cyclic[{c1,c2,…}] cycle through all ci {s1,s2,…,Cyclic[{c1,c2,…}],sm,…,sn} use the first sequence of si at the beginning, then cyclically use the ci, then use the last sequence of si at the end {s1,s2,…,Cyclic[{}],sm,…,sn} use the first sequence of si at the beginning and the last sequence at the end - The columns coli can be a column key "key" or the numerical index i of the column.
- The row rowi can be the numerical index i of the row, or RowKey[{…}] if Tabular contains key columns.
- "RowValueFunction"f applies the function f to each row of data, and it should either return a setting to use for the entire row or a list of keyval results indicating what settings to use per column.
- "ItemValueFunction" takes the following forms:
-
itfn use itfn to generate the setting for every item {col1itfn1,…}} use itfni to generate the setting for items in column coli - The arguments supplied to item value functions are the value val of the item, the position {row,col} in the tabular and the entire tabular object tab.
- "RowValueFunction" takes the following forms:
-
rwfn use rwfn to generate the setting for every item {col1rwfni,…}} use rwfn to generate the setting for items in column coli - The arguments supplied to row value functions are the association of row elements assoc, the row position row in the tabular and the entire tabular object tab.


Examples
open all close allBasic Examples (5)
Scope (28)
Creating Tabular Objects (12)
Construct a Tabular object from a list of rows:
Construct a Tabular object from a matrix, specifying column names:
Construct a Tabular object from a list of associations:
Create a Tabular object from a list of associations with ExtendedKey:
Create a Tabular object from a QuantityArray:
Tabular object from column-oriented list data requires Transpose:
Use ToTabular instead:
Convert a Dataset into a Tabular object:
Converting to Tabular will flatten the dataset structure:
Use Import of "CSV" to automatically get a Tabular object:
Import a "TSV" file:
Construct a Tabular object of numbers, specifying the type of the elements of each column:
Mix columns of different types:
Tabular stores them by default as strings:
Convert to "CategoricalOrdered" type, internally storing a single copy of each size value:
Show a Tabular object whose rows correspond to entities and whose columns are entity properties:
Extracting Data (9)
Extract a single element Tabular object:
Extract a column using a column key:
Extract a row of a Tabular object with a key column:
Extract a row of a Tabular object with several key columns:
Extract multiple columns from a Tabular object:
Extract two columns and reverse their order:
Extract multiple columns by column keys:
Use conditions to select rows:
Extract all the rows with "SepalLength" greater than or equal to 6:
Cleaning Data (4)
Take a Tabular object of country data:
Sort by decreasing values of population:
Options (26)
Background (13)
Use a single style as the background for all the items:
Specify backgrounds for every column:
Specify backgrounds for every row:
If there are more columns than styles, the later columns use default styling:
If there are more rows than styles, the later rows use default styling:
Cycle between blue and green column backgrounds:
Cycle between blue and green row backgrounds:
Start and end with blue and red column backgrounds, and cycle between orange and green in between:
Start and end with blue and red row backgrounds, and cycle between orange and green in between:
Start and end with blue and red column backgrounds, and use the default styling in between:
Start and end with blue and red row backgrounds, and use the default styling in between:
Use a blue background for the column "b":
Use a blue background for the second row:
Use RowKey[{…}] to style a row:
Specify the background style of an item using its {row,col} position:
Color row backgrounds red if the value in column "b" is more than 10, and blue otherwise:
Use None to use the default background style:
Color the "b" column based on its value:
Color item backgrounds red if the value is even, and blue otherwise:
Use None to use the default background style:
ItemStyle (13)
Use a single style as the style for all the items:
Use Directive to combine styles into a single style:
Specify styles for every column:
If there are more columns than styles, the later columns use default styling:
If there are more rows than styles, the later rows use default styling:
Cycle between blue and green column styles:
Cycle between blue and green row styles:
Start and end with blue and red column styles, and cycle between orange and green in between:
Start and end with blue and red row styles, and cycle between orange and green in between:
Start and end with blue and red column styles, and use the default styling in between:
Start and end with blue and red row styles, and use the default styling in between:
Use a blue style for the column "b":
Use a blue style for the second row:
Use RowKey[{…}] to style a row:
Specify the styles style of an item using its {row,col} position:
Color row styles red if the value in column "b" is more than 10, and blue otherwise:
Use None to use the default style:
Color the "b" column based on its value:
Color items red if the value is even, and blue otherwise:
Use None to use the default style:
Applications (2)
Use a Tabular object to display column data with separate column headings:
Use the array data and "ColumnHeadings" property to create a Tabular object:
Plot petal length as a function of sepal length:
Compute mean values of flower measurements depending on the species type:
Information about "DuneBooks" in Tabular form:
Properties & Relations (3)
Use TabularQ to test if a Tabular object is valid:
The columns of a Tabular object are given as TabularColumn objects:
The rows of a Tabular object are given as TabularRow objects:
Possible Issues (3)
Tabular input data must be at least two dimensional:

Raggedness in the second level is not accepted:

Arrays must be rectangular in the first two levels:
A Tabular object cannot have repeated column keys, which makes Part eliminate duplicates:
Map the Part extraction to generate duplicate columns:
Create a Tabular object without column keys or with different column keys:
History
Text
Wolfram Research (2025), Tabular, Wolfram Language function, https://reference.wolfram.com/language/ref/Tabular.html.
CMS
Wolfram Language. 2025. "Tabular." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Tabular.html.
APA
Wolfram Language. (2025). Tabular. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Tabular.html
BibTeX
@misc{reference.wolfram_2025_tabular, author="Wolfram Research", title="{Tabular}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/Tabular.html}", note=[Accessed: 12-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_tabular, organization={Wolfram Research}, title={Tabular}, year={2025}, url={https://reference.wolfram.com/language/ref/Tabular.html}, note=[Accessed: 12-August-2025]}