Home Search

DriveWorks Pro 22
SppConvertTableToHTMLTable

Send Feedback

SppConvertTableToHTMLTable

This function constructs a HTML table from a DriveWorks table.

Syntax

SppConvertTableToHTMLTable([Table array])

Where:

Table array is the Table array to be converted to a HTML table.

This function will return an error when:

  • Table data is not an array format
  • Table does not contain rows or columns
  • Fails to retrieve DriveWorks current culture
  • Fails to convert into HTML table

Examples

RuleMeaning
SppConvertTableToHTMLTable(DwLookupOfficeSupplies)Will convert the table Office Supplies into HTML.
SppConvertTableToHTMLTable({"Item","Price","Quantity";"HB Pencil","0.60","3"})Will convert the given array into HTML.

Escaping Characters

The following are escaping characters and, if they exist in the table array, will be converted in the result:

CharacterReplaced with
<&lt;
>&gt;
&&amp;
"&quot;

Example DriveWorks Table

The table OfficeSupplies contains the following data:

ItemPriceQuantity
HB Pencil0.603
2B Pencil0.602
Black Biro0.801
Rubber1.501
HB Pencil0.602
Black Biro0.801

Result as HTML

The table above will result in the following HTML:

<table>
    <tr>
        <th>Item</th>
        <th>Price</th>
        <th>Quantity</th>
    </tr>
    <tr>
        <td>HB Pencil</td>
        <td>0.60</td>
        <td>3</td>
    </tr>
    <tr>
        <td>2B Pencil</td>
        <td>0.60</td>
        <td>2</td>
    </tr>
    <tr>
        <td>Black Biro</td>
        <td>0.80</td>
        <td>1</td>
    </tr>
    <tr>
        <td>Rubber</td>
        <td>1.50</td>
        <td>1</td>
    </tr>
    <tr>
        <td>HB Pencil</td>
        <td>0.60</td>
        <td>2</td>
    </tr>
    <tr>
        <td>Black Biro</td>
        <td>0.80</td>
        <td>1</td>
    </tr>
</table>