Column Widths with Merged Cells (possible minimum width?)

May 5, 2011 at 12:28 AM

PHP 5.2.x, PHPExcel 1.7.6, Windows Server

Default behavior for setting a column to automatic width with merged cells ignores merged cells when calculating the width. However, I need to be able to display those cells in their entirety. I would love to somehow used automatic width, and be able to specify a minimum width (maybe even based on the content for those merged cells) for a range of rows.

It's hard to explain, but currently I have some PHP doing calculations on string length in order to dynamically set widths to accommodate a 'minimum width' in order to keep all text in merged cells visible while making cells that are not merged collapse over/under those troublesome merged cells.

Basically it extends the right most column to take up the slack, allowing the merged cell to be completely visible, but also aligning non-merged cells properly.

If I'm making any sense, I was hoping someone out there has some PHPExcel magic that might make my life a little easier?