HtmlTable
Vue de l’ensemble
HtmlTable est une classe dans Aspose.Cells FOSS pour Typescript.
HtmlTable.parse(html, cssClasses) parse une seule ligne de table HTML dans un objet Hdml Table, en appliquant des filtres de classe CSS facultatifs.
Cette classe fournit 10 méthodes pour travailler avec des objets HtmlTable dans les programmes de type. Les méthodologies disponibles comprennent: addHeader, adRow , ‘constructor;getCellStyle; mergeTables : parse et parseAll . setCssClasses à HTML, à WordShot. Tous les membres publics sont accessibles à toute application TypeScript après l’installation du package TypeScope Aspose.Cells FOSS. Propriétés : caption., colWidths.
Description
HtmlTable est une classe dans la bibliothèque Aspose.Cells FOSS pour TypeScript qui expose 9 méthodes et 14 propriétés pour l’utilisation programmée.
Les fonctionnalités de base comprennent : : nombre; : nombre' ;. ces opérations permettent aux développeurs d’intégrer directement la fonctionalité du tableau html dans les applications TypeScript.
La classe fournit également la propriété des « colls » (qui prend les cols), la « compte » propriétés (qu’il prend le nombre), l’« hauteur » propiété (que prend la haute).
Les instances sont créées à travers un constructeur unique qui initialisera l’objet avec des valeurs par défaut.
Propriétés
| Name | Type | Access | Description |
|---|---|---|---|
cols | : number | Read | Gets the cols. |
count | : number | Read | Gets the count. |
height | : number | Read | Gets the height. |
caption | `string | undefined` | Read |
headers | string[] | Read | Gets the headers. |
rows | string[][] | Read | Gets the rows. |
colWidths | number[] | Read | Gets the col widths. |
rowHeights | number[] | Read | Gets the row heights. |
hiddenRows | boolean[] | Read | Gets the hidden rows. |
pictures | PictureInfo[] | Read | Gets the pictures. |
style | : string | Read | Gets the style. |
color | : string | Read | Gets the color. |
méthodes
| Signature | Description |
|---|---|
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 | undefined` |
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>) → HtmlTable | Parses a single HTML table into an HtmlTable object, which can then be written to a worksheet via toWorksheet |
mergeTables(tables: HtmlTable[]) → HtmlTable | Combines multiple HtmlTable instances into a single table, preserving rows and columns |
toHtml(options: HtmlSaveOptions) → string | Serializes the HtmlTable to an HTML string using the specified save options. |
Voir aussi
- Aspose.Cells — référence API d’entreprise