Cell
Cell intended to provide user access to the contents of Cell within an xlsx.Row.
const cell = row.addCell();
cell.value = 'I am a cell!';
cell.hMerge = 2;
cell.vMerge = 1;
cell.style.fill.patternType = 'solid';
cell.style.fill.fgColor = '00FF0000';
cell.style.fill.bgColor = 'FF000000';
cell.style.align.h = 'center';
cell.style.align.v = 'center';
Set the cell value
const cell = row.addCell();
// Date type
cell.setDate(new Date());
// Number type
cell.setNumber(123456);
cell.numFmt = '$#,##0.00';
Constructor Summary
Private Constructor | ||
private |
Create a cell and add it to a row. |
Member Summary
Public Members | ||
public |
Horizontal merge with other cells. |
|
public |
Hide the cell. |
|
public |
Number format @see NumFmt |
|
public get |
Get the cell style. |
|
public set |
Set the style of the cell. |
|
public |
Vertical merge with other cells. |
|
public get |
value: * Get the cell value. |
|
public set |
Set the cell value. |
Method Summary
Public Methods | ||
public |
Set cell value with Boolean type. |
|
public |
Set cell value with Date type. |
|
public |
setDateTime(v: Date) Set cell value with DateTime type. |
|
public |
setFormula(f: String) Set cell formula. |
|
public |
Set cell value with Number type. |
|
public |
Set cell value with String type. |
Private Constructors
Public Members
Public Methods
public setBool(v: Boolean) source
Set cell value with Boolean type.
Params:
Name | Type | Attribute | Description |
v | Boolean |
public setDate(v: Date) source
Set cell value with Date type.
Params:
Name | Type | Attribute | Description |
v | Date |
public setDateTime(v: Date) source
Set cell value with DateTime type.
Params:
Name | Type | Attribute | Description |
v | Date |
public setFormula(f: String) source
Set cell formula.
Params:
Name | Type | Attribute | Description |
f | String | Formula like |