Skip to content

Basic Table

Basic Example

A basic <BasicTable> element using Bootstrap 5 for styling. This component takes an array of objects and renders an accessible (508 compliant) data table where each key/value pair corresponds to a column header/value. If the data is not in this format, you can include a tableAdapter function that accepts your data and transforms it into the necessary format. For more information on Harness-Vue tableAdapter functions see the section on Structured Data and Tables in the Harness-Vue documentation.

Transformed keyTransformed key 2
VALUE TRANSFORMED UPPERCASEVALUE2 TRANSFORMED UPPERCASE
VALUE3 TRANSFORMED UPPERCASEVALUE4 TRANSFORMED UPPERCASE
VALUE5 TRANSFORMED UPPERCASEVALUE6 TRANSFORMED UPPERCASE

Usage

kebab-case

html
    <basic-table :chart="{ key: 'exampleTable' }" />

PascalCase

html
    <BasicTable :chart="{ key: 'exampleTable' }" />

Page Definition

js
import { components } from '@rtidatascience/harness-vue-bootstrap'
components['BasicTable'] // array syntax
components.BasicTable // object syntax
'BasicTable' // string syntax if mixin installed

Props

chart

The chart object to render (Note: this is automatically handled by ChartGrid, so if you are using the grid you don't need this in your page definition)

  • Type: Object
  • Required: Yes

tableClass

A string appended to the class of the table, for applying bootstrap table options. This can also be used for applying user-created classes as well.

  • Type: String
  • Required: No
  • Default: null

Example table-hover

Transformed keyTransformed key 2
VALUE TRANSFORMED UPPERCASEVALUE2 TRANSFORMED UPPERCASE
VALUE3 TRANSFORMED UPPERCASEVALUE4 TRANSFORMED UPPERCASE
VALUE5 TRANSFORMED UPPERCASEVALUE6 TRANSFORMED UPPERCASE
html
<BasicTable class="table-hover" />

headerClass

A string appended to the class of the <thead> element, for applying bootstrap table options. This can also be used for applying user-created classes as well.

  • Type: String
  • Required: No
  • Default: null

Example thead-dark

Transformed keyTransformed key 2
VALUE TRANSFORMED UPPERCASEVALUE2 TRANSFORMED UPPERCASE
VALUE3 TRANSFORMED UPPERCASEVALUE4 TRANSFORMED UPPERCASE
VALUE5 TRANSFORMED UPPERCASEVALUE6 TRANSFORMED UPPERCASE
html
<BasicTable headerClass="thead-dark" />

labelClass

A string appended to the class of each <th> element, for applying bootstrap table options. This can also be used for applying user-created classes as well.

  • Type: String
  • Required: No
  • Default: null

rowClass

A string appended to the class of each <tr> element, for applying bootstrap table options. This can also be used for applying user-created classes as well.

  • Type: String
  • Required: No
  • Default: null

Example table-success

Transformed keyTransformed key 2
VALUE TRANSFORMED UPPERCASEVALUE2 TRANSFORMED UPPERCASE
VALUE3 TRANSFORMED UPPERCASEVALUE4 TRANSFORMED UPPERCASE
VALUE5 TRANSFORMED UPPERCASEVALUE6 TRANSFORMED UPPERCASE
html
<BasicTable rowClass="table-success" />

cellClass

A string appended to the class of each <td> element, for applying bootstrap table options. This can also be used for applying user-created classes as well.

  • Type: String
  • Required: No
  • Default: null

Example table-danger

Transformed keyTransformed key 2
VALUE TRANSFORMED UPPERCASEVALUE2 TRANSFORMED UPPERCASE
VALUE3 TRANSFORMED UPPERCASEVALUE4 TRANSFORMED UPPERCASE
VALUE5 TRANSFORMED UPPERCASEVALUE6 TRANSFORMED UPPERCASE
html
<BasicTable cellClass="table-danger" />

rowHeaderCol

Adds scope="row" to the first cell in each row to make it a row header

  • Type: Boolean
  • Required: No
  • Default: false

Example true

Transformed keyTransformed key 2
VALUE TRANSFORMED UPPERCASEVALUE2 TRANSFORMED UPPERCASE
VALUE3 TRANSFORMED UPPERCASEVALUE4 TRANSFORMED UPPERCASE
VALUE5 TRANSFORMED UPPERCASEVALUE6 TRANSFORMED UPPERCASE
html
<BasicTable :rowHeaderCol="true" />