Table Component Reference

Table of Contents


Introduction

Syntax

tml`<Table table=${myArray} />`
tml`<Table table=${myArray} header=headerString/>`

The Table component builds an HTML <table> from a JavaScript Array. The array is passed in the table attribute. The Table component is not intended to completely eliminate the need for using <table> components. It is intended to simplify often-used table layouts.

Table array

The table array contains row elements. Each row element contains an array of column elements. A column entry can be text, a plain object, or a template. If a plain object, it contains a value property and an optional props property. The props property contains the attributes for a <td> or <th> HTML element, including colspan and rowspan, which behave similarly.

Header layout

The header attribute specifies how headers are handled. It can take the following values:

Attributes

Children

The Table component ignores any children

DOM element properties