Spry

Specify a header row as data

A header row (or th tag) is the first row of an HTML table. By default, Spry uses this row to define the column names when it creates an HTML data set. You can then use these column names as data references when you display data in a Spry region.

If the first row in your table is actually data, you can specify it as such in the data set constructor.

 To specify a header as data rather than a column name, add the firstRowAsHeader option with a value of false to the constructor, as follows:
var ds2 = new Spry.Data.HTMLDataSet("products.html", "productsTable", {firstRowAsHeaders:false});

To access the data after you’ve disabled column names, use {column#} as the syntax in your data references. Spry uses a zero-based counting system, with column numbers starting at zero (0), so use {column0} for the first column of data in the source table, {column1} for the second column, and so on.

Row #

First column from source table

Third column from source table

{ds_RowNumberPlus1}

{column0}

{column2}

Do not use spaces or other tags in your data references for headers. Spry replaces spaces with underscores (_) and removes tags. For example, if the value of one of your headers is <strong>product features</strong>, enter your data reference for the spry:region value as {product_features}. Column names are case sensitive.