Data table

Extended from PrimeVue DataTable

Basic example

Advantages
Disadvantages
Saves money on electricitySavings are lower than with a solar loan or cash purchases
Low or no upfront costsCan't take advantage of the federal solar tax credit and other state and local incentives
May be an attractive feature to some homebuyersComplicates selling your home
No maintenance responsibilitiesLeasing companies sometimes neglect their maintenance responsibilities

Custom rendering

Cost before
Cost after
Local rebate$10,000$8,000
State tax credit$20,000$10,000
Federal tax credit$30,000$20,000

Sortable

Apply the sortable prop to a column to indicate that the user should be able to change the sort order of the rows based on that column's data. To set the initial state of the table to be sorted by a particular column, use the sortField and sortOrder props of the data table.

Name
Abbreviation
Capital
Year admitted
AlabamaALMontgomery1819
AlaskaAKJuneau1959
ArizonaAZPhoeniz1912
ArkansasARLittle Rock1836
CaliforniaCASacramento1850
ColoradoCODenver1876
ConnecticutCTHartford1788
DelawareDEDover1787
FloridaFLTallahassee1845
GeorgiaGAAtlanta1788
HawaiiHIHonolulu1959
IdahoIDBoise1890
IllinoisILSpringfield1818
IndianaINIndianapolis1816
IowaIADes Moines1846
KansasKSTopeka1861
KentuckyKYFrankfort1792

Limited height with sticky header

For long tables, it's possible to show a limited number of rows by setting a fixed height. The user can then scroll within the table to see the remaining rows.

It's best to use this sparingly, since this causes a situation of double scrolling and can make it difficult for users on touch devices to scroll past the table without scrolling to the end of the table. If it must be used, try to set the fixed height such that a partial row is visible, to indicate to the user there is more content that can be scrolled into view.

Name
Abbreviation
Capital
Year admitted
AlabamaALMontgomery1819
AlaskaAKJuneau1959
ArizonaAZPhoeniz1912
ArkansasARLittle Rock1836
CaliforniaCASacramento1850
ColoradoCODenver1876
ConnecticutCTHartford1788
DelawareDEDover1787
FloridaFLTallahassee1845
GeorgiaGAAtlanta1788
HawaiiHIHonolulu1959
IdahoIDBoise1890
IowaIADes Moines1846
IllinoisILSpringfield1818
IndianaINIndianapolis1816
KansasKSTopeka1861
KentuckyKYFrankfort1792

Freeze one column

This example shows how to use the frozen prop on a column to ensure it stays visible while scrolling the table contents horizontally. This feature is especially useful on mobile when the first column contains primary information that is important to reference when reading the contents of the subsequent columns.

Name
Abbreviation
Capital
Year admitted
AlabamaALMontgomery1819
AlaskaAKJuneau1959
ArizonaAZPhoeniz1912
ArkansasARLittle Rock1836
CaliforniaCASacramento1850
ColoradoCODenver1876
ConnecticutCTHartford1788
DelawareDEDover1787
FloridaFLTallahassee1845
GeorgiaGAAtlanta1788
HawaiiHIHonolulu1959
IdahoIDBoise1890
IowaIADes Moines1846
IllinoisILSpringfield1818
IndianaINIndianapolis1816
KansasKSTopeka1861
KentuckyKYFrankfort1792

EsDataTable props

For additional EsDataTable props beyond the ones listed below, please reference the PrimeVue DataTable props. Note that styling for features of the data table not demonstrated above may not be supported.

Name
items
Type
Array
Default
n/a
Description
Required. An array of objects to display.
Name
scrollable
Type
Boolean
Default
false
Description
When specified, limits the height of the table and enables scrolling.
Name
scrollHeight
Type
String
Default
305px
Description
Height of the scrollable table. Only applies when scrollable is true.

EsDataTableColumn props

For the props available to pass into EsDataTableColumn, please reference the PrimeVue Column props.