addBreak
addBreak

Inserts a row or column break into the Excel spreadsheet.
Description
public addBreak($position, $type = 'row')
This method allows the insertion of a break into the sheet.
Parameters
position
Integer value: 1, 2, 5...
type
'row' or 'col'.
Code samples
x
1
require_once 'classes/CreateXlsx.php';
2
3
$xlsx = new CreateXlsx();
4
5
// add sample contents
6
$content = array(
7
'text' => 'First content.',
8
);
9
$xlsx->addCell($content, 'A1');
10
11
$content = array(
12
'text' => 'Next content.',
13
);
14
$xlsx->addCell($content, 'A5');
15
16
$content = array(
17
'text' => 'Other content.',
18
);
19
$xlsx->addCell($content, 'F10');
20
21
// add breaks
22
$xlsx->addBreak(2, 'row');
23
24
$xlsx->addBreak(4, 'row');
25
26
$xlsx->addBreak(5, 'col');
27
28
$xlsx->saveXlsx('output');
29
Release notes
- phpxlsx 1.0:
- new method.