Table
Tables display data in rows and columns. They order information so that people can easily scan and analyse data.
Built with DataTables
Section titled “Built with DataTables”Relies on the third-party libraryDataTablesfor its features and functionality.View all resources
Ask a dev lead for more documentation on this component.
<table id="myTable" class="data-table" width="100%" data-archive="" data-source=""> <thead> <tr> <th data-prop="columnHeader" class="" data-type="">columnHeader</th> … </tr> </thead></table>
<script> System.import('tables').then(function () {
$('#myTable').tablify({ … });
});</script>Cell typeAlignmentPropertyTD classCopy
- stringleft
data-type=“string”string-cell - linkleft
data-type=“link”link-cell - dateleft
data-type=“date”datetime-cell - numberright
data-type=“number”number-cell - percentright
data-type=“percent”percent-cell - fractionright
data-type=“fraction”fraction-cell - decimalright
data-type=“decimaldecimal-cell - proper fractionright
data-type=“properFraction”properFraction-cell - booleancenter
data-type=“boolean”bool-cell(outputs check icon if true) - string arrayleft
data-type=“stringArray”stringArray-cell - blankleft
escaped-cell
Ask a dev lead for more documentation on this component.
import { DataTable, Row, ORDER_DIRECTION_ASCENDING, ORDER_DIRECTION_DESCENDING} from 'react-p21';
function () { return ( <> <DataTable ref={this.table} columns={this.columns} extraFilters={this.getFilterBar} groupBy={['groupName']} groupHeader={groupHeader} initialOrder={[ { id: 'dataset', direction: ORDER_DIRECTION_ASCENDING }, { id: 'rule', direction: ORDER_DIRECTION_ASCENDING }, { id: 'affected', direction: ORDER_DIRECTION_DESCENDING }, { id: 'change', direction: ORDER_DIRECTION_DESCENDING } ]} onLoad={this.onTableLoad} downloadFileName={toFileName('myTableFile')} /> </> );}Native HTML table element
Section titled “Native HTML table element”<table class="table"> <thead> <tr> <th>…</th> <th>…</th> <th class="text-right">…</th> <th class="text-center">…</th> </tr> </thead> <tbody> <tr> <td>…</td> <td>…</td> <text-right">…</td> <text-center">…</td> </tr> </tbody></table>NameCodeCopy
- Bordered
<table class=“table table-bordered”> Align text left (default)
no class neededAlign text right (add to td or th)
<td class=“text-right”>Align text center (add to td or th)
<td class=“text-center”>