HtmlTable

Overview

HtmlTable is a class in Aspose.Cells FOSS for Typescript.

HtmlTable.parse(html, cssClasses) parses a single HTML table string into an HtmlTable object, applying optional CSS class filters.

This class provides 10 methods for working with HtmlTable objects in Typescript programs. Available methods include: addHeader, addRow, constructor, getCellStyle, mergeTables, parse, parseAll, setCssClasses, toHtml, toWorksheet. All public members are accessible to any Typescript application after installing the Aspose.Cells FOSS for Typescript package. Properties: caption, colWidths, color, cols, count, headers, and 6 more.

Description

HtmlTable is a class in the Aspose.Cells FOSS library for TypeScript that exposes 9 methods and 14 properties for programmatic use.

Core capabilities include: : number; : number; : number. These operations enable developers to integrate htmltable functionality directly into TypeScript applications.

The class also provides the cols property (gets the cols), the count property (gets the count), the height property (gets the height).

Instances are created through a single constructor that initializes the object with default values.

Properties

NameTypeAccessDescription
cols: numberReadGets the cols.
count: numberReadGets the count.
height: numberReadGets the height.
captionstring | undefinedReadGets the caption.
headersstring[]ReadGets the headers.
rowsstring[][]ReadGets the rows.
colWidthsnumber[]ReadGets the col widths.
rowHeightsnumber[]ReadGets the row heights.
hiddenRowsboolean[]ReadGets the hidden rows.
picturesPictureInfo[]ReadGets the pictures.
style: stringReadGets the style.
color: stringReadGets the color.

Methods

SignatureDescription
constructor(caption: string)Creates a new HtmlTable with the specified caption text.
setCssClasses(classes: Map<string, CellStyle>)Sets the css classes value.
getCellStyle(row: number, col: number)CellStyle | undefinedReturns a CellStyle object for the specified cell or undefined if no style is defined
addHeader(header: string)Adds a column header string to the table.
addRow(row: string[])Appends an array of cell values as a new row to the table.
parseAll(html: string, cssClasses: Map<string, CellStyle>)HtmlTable[]Parses all HTML tables in an HTML string and returns them as an array of HtmlTable objects.
toWorksheet(worksheet: Worksheet, options: HtmlParseOptions)Writes this HtmlTable’s data into the specified Worksheet using the given parse options.
parse(html: string, cssClasses: Map<string, CellStyle>)HtmlTableParses a single HTML table into an HtmlTable object, which can then be written to a worksheet via toWorksheet
mergeTables(tables: HtmlTable[])HtmlTableCombines multiple HtmlTable instances into a single table, preserving rows and columns
toHtml(options: HtmlSaveOptions)stringSerializes the HtmlTable to an HTML string using the specified save options.

See Also