Read style format

  • Extension version 1.6.0 or later;

  • Build with --enable-reader;

Resolves the style_id reported by nextRowWithFormula() into a complete description of the cell's formatting.

Methods

getStyleFormat(int $style_id): ?array

int $style_id

Style index, matching an <xf> entry in xl/styles.xml.

Return value

The fields below are grouped by topic.

Number format

  • num_fmt_id (int) — number format id;

  • category (string)number, percent, date, time, datetime, currency, text, custom, general;

  • format_string (string) — format code.

Table indices

  • font_id (int), fill_id (int), border_id (int).

Alignment / protection

  • alignment (array){horizontal, vertical, wrap_text, indent, rotation};

  • protection (array){locked, hidden}; locked defaults to true.

Font

  • font (array){name, size, color, bold, italic, strike, underline}.

Fill

  • fill (array){pattern_type, fg_color, bg_color}.

Border

  • border (array){left, right, top, bottom}, each side as {style, color}.

Returns null when style_id is out of range.

Example

Last updated