The Colinfo Object

class Colinfo

Width and default formatting information that applies to one or more columns in a sheet. Derived from COLINFO records.

Here is the default hierarchy for width, according to the OOo docs:

In BIFF3, if a COLINFO record is missing for a column, the width specified in the record DEFCOLWIDTH is used instead.

In BIFF4-BIFF7, the width set in this [COLINFO] record is only used, if the corresponding bit for this column is cleared in the GCW record, otherwise the column width set in the DEFCOLWIDTH record is used (the STANDARDWIDTH record is always ignored in this case [see footnote!]).

In BIFF8, if a COLINFO record is missing for a column, the width specified in the record STANDARDWIDTH is used. If this [STANDARDWIDTH] record is also missing, the column width of the record DEFCOLWIDTH is used instead.

Footnote:

The docs on the GCW record say this:

If a bit is set, the corresponding column uses the width set in the STANDARDWIDTH record. If a bit is cleared, the corresponding column uses the width set in the COLINFO record for this column.

If a bit is set, and the worksheet does not contain the STANDARDWIDTH record, or if the bit is cleared, and the worksheet does not contain the COLINFO record, the DEFCOLWIDTH record of the worksheet will be used instead.

At the moment (2007-01-17) xlrd is going with the GCW version of the story. Reference to the source may be useful: see the computed_column_width(colx) method of the Sheet class.

  • New in version 0.6.1
Colinfo.hidden

1 = column is hidden

Colinfo.outline_level

Outline level of the column, in range(7). (0 = no outline)

Colinfo.width

Width of the column in 1/256 of the width of the zero character, using default font (first FONT record in the file).

Colinfo.xf_index

XF index to be used for formatting empty cells.

Previous topic

The Cell Object

Next topic

The EqNeAttrs Mixin

This Page