columns
(mPDF ≥ 1.0)
columns – Control use of Columns on the page
Description
<columns $column-count [ $vAlign ] [ $column-gap ] />
Define, start or stop Columns in the document.
Note: The maximum ratio to adjust column height when justifying is set by $max_colH_correction - too large a value can give ugly results
Note: If you are setting HTMLHeaders or HTMLFooters, this will cancel any columns you have set;
you need to call SetColumns()
or use <columns>
after commands like
SetHTMLHeader() etc.
Parameters
- $column-count
-
Set the number of (vertical) columns to use on a page
BLANK or omitted or
'0'
or'1'
turns Columns OFF i.e. the whole page is used as one column.Default:
'1'
- $vAlign
-
Automatically adjusts height of columns to be equal if set to
'J'
or'justify'
.BLANK or omitted turns vertical-alignment OFF
Values (case-insensitive)
'J'
or'justify'
Default:
""
- $column-gap
-
Set the gap between columns in millimeters
BLANK or omitted uses default value.
Default:
"5"
(mm)
Examples
Example #1
<?php
$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML('<columns column-count="3" vAlign="J" column-gap="7" />');
$mpdf->WriteHTML('Some text...');
$mpdf->WriteHTML('<columnbreak />');
$mpdf->WriteHTML('Next column...');
$mpdf->Output();
See Also
- AddColumn() - Start a new Column
- <columnbreak> - Start a new Column
- SetColumns() -
Control the use of multiple columns on the page - PHP equivalent of
<columns>