TCPDF::getCellCode( $w,  $h,  $txt = '',  $border,  $ln,  $align = '',  $fill = false,  $link = '',  $stretch,  $ignore_min_height = false,  $calign = 'T',  $valign = 'M' )

Returns the PDF string code to print a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.


Description Description

See also See also


Top ↑

Parameters Parameters

$w

(Required) (float) Cell width. If 0, the cell extends up to the right margin.

$h

(Required) (float) Cell height. Default value: 0.

$txt

(Optional) (string) String to print. Default value: empty string.

Default value: ''

$border

(Required) (mixed) Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))

$ln

(Required) (int) Indicates where the current position should go after the call. Possible values are:<ul><li>0: to the right (or left for RTL languages)</li><li>1: to the beginning of the next line</li><li>2: below</li></ul>Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.

$align

(Optional) (string) Allows to center or align the text. Possible values are:<ul><li>L or empty string: left align (default value)</li><li>C: center</li><li>R: right align</li><li>J: justify</li></ul>

Default value: ''

$fill

(Optional) (boolean) Indicates if the cell background must be painted (true) or transparent (false).

Default value: false

$link

(Optional) (mixed) URL or identifier returned by AddLink().

Default value: ''

$stretch

(Required) (int) font stretch mode: <ul><li>0 = disabled</li><li>1 = horizontal scaling only if text is larger than cell width</li><li>2 = forced horizontal scaling to fit cell width</li><li>3 = character spacing only if text is larger than cell width</li><li>4 = forced character spacing to fit cell width</li></ul> General font stretching and scaling values will be preserved when possible.

$ignore_min_height

(Optional) (boolean) if true ignore automatic minimum height value.

Default value: false

$calign

(Optional) (string) cell vertical alignment relative to the specified Y value. Possible values are:<ul><li>T : cell top</li><li>C : center</li><li>B : cell bottom</li><li>A : font top</li><li>L : font baseline</li><li>D : font bottom</li></ul>

Default value: 'T'

$valign

(Optional) (string) text vertical alignment inside the cell. Possible values are:<ul><li>T : top</li><li>M : middle</li><li>B : bottom</li></ul>

Default value: 'M'


Top ↑

Return Return

(string) containing cell code


Top ↑

Source Source

File: includes/lib/tcpdf/tcpdf.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.