PHPOffice / PHPExcel

ARCHIVED
Other
11.46k stars 4.19k forks source link

Excel2007: centerContinuous horizontal alignment should merge the cells. #232

Open ChALkeR opened 11 years ago

ChALkeR commented 11 years ago

The title pretty much says it.

There are at least two ways of merging cells in Excel2007:

  1. mergeCellsmergeCell
  2. centerContinuous horizontal alignment.

The latter is not supported for reading in PHPExcel.

See 18.18.40 ST_HorizontalAlignment (Horizontal Alignment Type) from ISO/IEC 29500-1:2012.

In short: if some consecutive cells in one row have an exact same style id that refers to a style that has the horizontal part of the alignment set to centerContinuous, that cells should be treated as a merged cell with a center horizontal alignment. The alignment merges the cells with the same style id.

ChALkeR commented 11 years ago

The question is: is PHPExcel supposed to manage such things or not?

ChALkeR commented 11 years ago

No, it seems that I was wrong about how this is supposed to work. Better look at the reference.

ChALkeR commented 11 years ago

For example, PHPExcel_Writer_HTML does not merge such cells.