Appearance
Function: cleanRows()
ts
function cleanRows(
ws: Worksheet,
rows: number[],
columns?: string[]): void;Defined in: src/excel/excel.tsx:185
Clear cells in specified rows. If columns are provided, only those columns are cleared. Otherwise all cells in each row are cleared.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
ws | Worksheet | undefined | The worksheet containing the rows and columns. |
rows | number[] | undefined | Row numbers to clear (e.g., [5, 6, 10]). |
columns | string[] | [] | Column letters to clear. If empty, all cells in the row are cleared. |
Returns
void
Example
ts
const worksheet = workbook.getWorksheet('Log');
cleanRows(worksheet, [5, 6, 10]);
cleanRows(worksheet, [5, 6, 10], ['C', 'D', 'E']);