htmltablecell(
htmltablecell(
TABLE
,
ROW
,
COLUMN
)

The htmltablecell( function extracts the data from a cell in an HTML table.

Parameters

This function has three parameters:

table – text of the HTML table. This parameter must contain the body of an HTML table with `<tr>` and `<td>` tags (however, the actual `<table>` and `</table>` tags themselves are not required.

row – row number within HTML table. Rows are numbered starting from 1.

column – column number within HTML table. Columns are numbered starting from 1.

Description

This function extracts the data from a cell in an HTML table. Any tags in the cell are removed, leaving only the actual text. Suppose you set up a variable with an HTML table, like this:

    local htable
    htable =
       "<tr><td><font size=-1>Alaska</font></td><td>AK</td></tr>
        <tr><td><font size=-1>Arizona</font></td><td>AR</td></tr>
        <tr><td><font size=-1>Wyoming</font></td><td>WY</td></tr>"

Once this variable is set up, you can extract different table elements using the htmltablecell( function.

    htmltablecell(htable,2,1) ☞ Arizona
    htmltablecell(htable,3,2) ☞ WY

This function removes any HTML tags that may have been in the cell. If you need the tags as well as the text, use the htmltablecellraw( function.

    htmltablecellraw(htable,2,1) ☞ <font size=-1>Arizona</font>
    htmltablecellraw(htable,3,2) ☞ WY

Note: This function is equivalent to:

    strip(tagstrip(arrayrange(tagdata(tagdata(thetable,"<tr","</tr>",row),"<td","</td>",col),2,9999,">"),"<",">"))

See Also

- HTML Export -- custom exports into an HTML file.
- htmlarraytable -- generates an HTML table from an arrray.
- htmldatamerge -- uses a template to generate HTML you want from a database.
- htmldatatable -- generates an HTML table from selected data in the current database.
- htmlextractimages -- extracts the image URLs from an HTML page.
- htmlextractlinks -- extracts the links from an HTML page.
- htmlformitemnames -- returns a list of form input elements (*INPUT* tags, etc.) within an HTML page.
- htmltablecellexists( -- returns true if an HTML table contains the specified cell, false if it doesn't.
- htmltablecellraw( -- extracts the data from a cell in an HTML table (including tags, if any).
- htmltableheight( -- calculates the height (number of rows) in an HTML table.
- htmltablerow( -- extracts the data from a row in an HTML table.
- htmltablerowraw( -- extracts the raw data (including tags, if any) from a row in an HTML table.
- htmltabletoarray -- converts an HTML table into a text array.
- htmltablewidth( -- calculates the width (number of columns) in an HTML table.
- xtag( -- generates an HTML/XML tag.

History

Version | Status | Notes
10.0 | No Change | Carried over from Panorama 6.0.