开发者

Spreadsheet_Excel_Writer making Rows width longer

How can I make rows a bit longer? If I output the excel everything prints fine, but if the title is a bit long th开发者_如何学Goe title is not readable.

How can I fix that?


It's probably the column width that needs fixing then.

Excel hides any content in a cell that runs wider than the column width it is in. It's just like CSS overflow property. Usually that is indicated by a small icon on the right hand side of the cell. Double clicking the right edge of the column will autoexpand the column. To have it visible right from the start, you'd have to increase the column width.

Example taken from this newsgroup entry

// Creating a workbook
$workbook = new Spreadsheet_Excel_Writer();

//Setting column width
$worksheets1->setColumn(0,0,10.00);

Quoting the same entry (fixed spelling):

This example breakdown is as follows...
setColumn(0,0,10.00) == the first column to be affected by the width
setColumn(0,0,10.00) == the last column to be affected by the width
setColumn(0,0,10.00) == the width as a float

The setColumn() needs to be set before any data is being written to the spreadsheet. If you only want one column to be affected by setColumn() then you set the first and last column params to the same column number. If you want to affect more than one column you can set the last column to the desired column number, just remember the column numbering begins with a 0.

In case that's not working with the PEAR package, try PHPExcel

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜