Snippets

Contents with line breaks

To add a line break in a cell content, "\n" must be added and the cell style 'wrapText' must be set to true.

x
 
1
$content = array(
2
    'text' => "Lorem ipsum dolor\nsit amet",
3
);
4
$cellStyles = array(
5
    'wrapText' => true,
6
);
7
$xlsx->addCell($content, 'A1', $cellStyles);
8
$xlsx->setColumnSettings('A', array('width' => 50));
9
$xlsx->setRowSettings(1, array('height' => 50));
10
­
­