A builder class for constructing and modifying a DataTable instance within a DataContainer.

This class provides methods to add row/s and add column header/s to a DataTable.

Example

const dataContainerBuilder = Parser.createContainerBuilder(initialDataContainer);
const { tableBuilder } = dataContainerBuilder.getTable('myTable');

// Add row and column header for a specific table
tableBuilder.addColumnHeader({ name: 'column1', dataType: 'string' });
tableBuilder.addColumnHeader({ name: 'column2', dataType: 'string' });
tableBuilder.addRow({ column1: 'value1', column2: 'value2' });

// Get the final DataContainer
const finalDataContainer = dataContainerBuilder.getDataContainer();

Hierarchy

  • DataTableBuilder

Methods

  • Adds a single column header to the DataTable.

    Parameters

    • column: ColumnHeader

      The column header to add to the DataTable.

    Returns void

  • Adds multiple column headers to the DataTable.

    Parameters

    • colHeaders: ColumnHeader[]

      The array of column headers to add to the DataTable.

    Returns void

  • Adds a single row to the DataTable.

    Parameters

    • row: DataRow

      The row to add to the DataTable.

    Returns void

  • Adds multiple rows to the DataTable.

    Parameters

    • rows: DataRow[]

      The array of rows to add to the DataTable.

    Returns void

Generated using TypeDoc