1<?php
2
3namespace Mpdf\Tag;
4
5use Mpdf\Css\Border;
6use Mpdf\Css\TextVars;
7use Mpdf\Utils\UtfString;
8
9class Td extends Tag
10{
11
12	public function open($attr, &$ahtml, &$ihtml)
13	{
14		$tag = $this->getTagName();
15
16		$this->mpdf->ignorefollowingspaces = true;
17		$this->mpdf->lastoptionaltag = $tag; // Save current HTML specified optional endtag
18
19		$this->cssManager->tbCSSlvl++;
20
21		$this->mpdf->InlineProperties = [];
22		$this->mpdf->InlineBDF = []; // mPDF 6
23		$this->mpdf->InlineBDFctr = 0; // mPDF 6
24		$this->mpdf->tdbegin = true;
25		$this->mpdf->col++;
26
27		while (isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col])) {
28			$this->mpdf->col++;
29		}
30
31		// Update number column
32		if ($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nc'] < $this->mpdf->col + 1) {
33			$this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nc'] = $this->mpdf->col + 1;
34		}
35
36		$table = &$this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]];
37
38		$c = ['a' => false,
39			'R' => false,
40			'nowrap' => false,
41			'bgcolor' => false,
42			'padding' => ['L' => false,
43				'R' => false,
44				'T' => false,
45				'B' => false
46			]
47		];
48
49		if ($this->mpdf->simpleTables && $this->mpdf->row == 0 && $this->mpdf->col == 0) {
50			$table['simple']['border'] = false;
51			$table['simple']['border_details']['R']['w'] = 0;
52			$table['simple']['border_details']['L']['w'] = 0;
53			$table['simple']['border_details']['T']['w'] = 0;
54			$table['simple']['border_details']['B']['w'] = 0;
55			$table['simple']['border_details']['R']['style'] = '';
56			$table['simple']['border_details']['L']['style'] = '';
57			$table['simple']['border_details']['T']['style'] = '';
58			$table['simple']['border_details']['B']['style'] = '';
59		} elseif (!$this->mpdf->simpleTables) {
60			$c['border'] = false;
61			$c['border_details']['R']['w'] = 0;
62			$c['border_details']['L']['w'] = 0;
63			$c['border_details']['T']['w'] = 0;
64			$c['border_details']['B']['w'] = 0;
65			$c['border_details']['mbw']['BL'] = 0;
66			$c['border_details']['mbw']['BR'] = 0;
67			$c['border_details']['mbw']['RT'] = 0;
68			$c['border_details']['mbw']['RB'] = 0;
69			$c['border_details']['mbw']['TL'] = 0;
70			$c['border_details']['mbw']['TR'] = 0;
71			$c['border_details']['mbw']['LT'] = 0;
72			$c['border_details']['mbw']['LB'] = 0;
73			$c['border_details']['R']['style'] = '';
74			$c['border_details']['L']['style'] = '';
75			$c['border_details']['T']['style'] = '';
76			$c['border_details']['B']['style'] = '';
77			$c['border_details']['R']['s'] = 0;
78			$c['border_details']['L']['s'] = 0;
79			$c['border_details']['T']['s'] = 0;
80			$c['border_details']['B']['s'] = 0;
81			$c['border_details']['R']['c'] = $this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings);
82			$c['border_details']['L']['c'] = $this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings);
83			$c['border_details']['T']['c'] = $this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings);
84			$c['border_details']['B']['c'] = $this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings);
85			$c['border_details']['R']['dom'] = 0;
86			$c['border_details']['L']['dom'] = 0;
87			$c['border_details']['T']['dom'] = 0;
88			$c['border_details']['B']['dom'] = 0;
89			$c['border_details']['cellposdom'] = 0;
90		}
91
92
93		if ($table['va']) {
94			$c['va'] = $table['va'];
95		}
96		if ($table['txta']) {
97			$c['a'] = $table['txta'];
98		}
99		if ($this->mpdf->table_border_attr_set && $table['border_details']) {
100			if (!$this->mpdf->simpleTables) {
101				$c['border_details']['R'] = $table['border_details']['R'];
102				$c['border_details']['L'] = $table['border_details']['L'];
103				$c['border_details']['T'] = $table['border_details']['T'];
104				$c['border_details']['B'] = $table['border_details']['B'];
105				$c['border'] = $table['border'];
106				$c['border_details']['L']['dom'] = 1;
107				$c['border_details']['R']['dom'] = 1;
108				$c['border_details']['T']['dom'] = 1;
109				$c['border_details']['B']['dom'] = 1;
110			} elseif ($this->mpdf->simpleTables && $this->mpdf->row == 0 && $this->mpdf->col == 0) {
111				$table['simple']['border_details']['R'] = $table['border_details']['R'];
112				$table['simple']['border_details']['L'] = $table['border_details']['L'];
113				$table['simple']['border_details']['T'] = $table['border_details']['T'];
114				$table['simple']['border_details']['B'] = $table['border_details']['B'];
115				$table['simple']['border'] = $table['border'];
116			}
117		}
118		// INHERITED THEAD CSS Properties
119		if ($this->mpdf->tablethead) {
120			if ($this->mpdf->thead_valign_default) {
121				$c['va'] = $this->getAlign($this->mpdf->thead_valign_default);
122			}
123			if ($this->mpdf->thead_textalign_default) {
124				$c['a'] = $this->getAlign($this->mpdf->thead_textalign_default);
125			}
126			if ($this->mpdf->thead_font_weight === 'B') {
127				$this->mpdf->SetStyle('B', true);
128			}
129			if ($this->mpdf->thead_font_style === 'I') {
130				$this->mpdf->SetStyle('I', true);
131			}
132			if ($this->mpdf->thead_font_smCaps === 'S') {
133				$this->mpdf->textvar |= TextVars::FC_SMALLCAPS;
134			} // mPDF 5.7.1
135		}
136
137		// INHERITED TFOOT CSS Properties
138		if ($this->mpdf->tabletfoot) {
139			if ($this->mpdf->tfoot_valign_default) {
140				$c['va'] = $this->getAlign($this->mpdf->tfoot_valign_default);
141			}
142			if ($this->mpdf->tfoot_textalign_default) {
143				$c['a'] = $this->getAlign($this->mpdf->tfoot_textalign_default);
144			}
145			if ($this->mpdf->tfoot_font_weight === 'B') {
146				$this->mpdf->SetStyle('B', true);
147			}
148			if ($this->mpdf->tfoot_font_style === 'I') {
149				$this->mpdf->SetStyle('I', true);
150			}
151			if ($this->mpdf->tfoot_font_style === 'S') {
152				$this->mpdf->textvar |= TextVars::FC_SMALLCAPS;
153			} // mPDF 5.7.1
154		}
155
156
157		if ($this->mpdf->trow_text_rotate) {
158			$c['R'] = $this->mpdf->trow_text_rotate;
159		}
160
161		$this->mpdf->cell_border_dominance_L = 0;
162		$this->mpdf->cell_border_dominance_R = 0;
163		$this->mpdf->cell_border_dominance_T = 0;
164		$this->mpdf->cell_border_dominance_B = 0;
165
166		$properties = $this->cssManager->MergeCSS('TABLE', $tag, $attr);
167
168		$properties = $this->cssManager->array_merge_recursive_unique($this->mpdf->base_table_properties, $properties);
169
170		$this->mpdf->Reset(); // mPDF 6   ?????????????????????
171
172		$this->mpdf->setCSS($properties, 'TABLECELL', $tag);
173
174		$c['dfs'] = $this->mpdf->FontSize; // Default Font size
175
176
177		if (isset($properties['BACKGROUND-COLOR'])) {
178			$c['bgcolor'] = $properties['BACKGROUND-COLOR'];
179		} elseif (isset($properties['BACKGROUND'])) {
180			$c['bgcolor'] = $properties['BACKGROUND'];
181		} elseif (isset($attr['BGCOLOR'])) {
182			$c['bgcolor'] = $attr['BGCOLOR'];
183		}
184
185
186
187		/* -- BACKGROUNDS -- */
188		if (isset($properties['BACKGROUND-GRADIENT'])) {
189			$c['gradient'] = $properties['BACKGROUND-GRADIENT'];
190		} else {
191			$c['gradient'] = false;
192		}
193
194		if (!empty($properties['BACKGROUND-IMAGE']) && !$this->mpdf->keep_block_together) {
195			$ret = $this->mpdf->SetBackground($properties, $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']);
196			if ($ret) {
197				$c['background-image'] = $ret;
198			}
199		}
200		/* -- END BACKGROUNDS -- */
201		if (isset($properties['VERTICAL-ALIGN'])) {
202			$c['va'] = $this->getAlign($properties['VERTICAL-ALIGN']);
203		} elseif (isset($attr['VALIGN'])) {
204			$c['va'] = $this->getAlign($attr['VALIGN']);
205		}
206
207
208		if (!empty($properties['TEXT-ALIGN'])) {
209			if (0 === strpos($properties['TEXT-ALIGN'], 'D')) {
210				$c['a'] = $properties['TEXT-ALIGN'];
211			} else {
212				$c['a'] = $this->getAlign($properties['TEXT-ALIGN']);
213			}
214		}
215		if (!empty($attr['ALIGN'])) {
216			if (strtolower($attr['ALIGN']) === 'char') {
217				if (!empty($attr['CHAR'])) {
218					$char = html_entity_decode($attr['CHAR']);
219					$char = UtfString::strcode2utf($char);
220					$d = array_search($char, $this->mpdf->decimal_align);
221					if ($d !== false) {
222						$c['a'] = $d . 'R';
223					}
224				} else {
225					$c['a'] = 'DPR';
226				}
227			} else {
228				$c['a'] = $this->getAlign($attr['ALIGN']);
229			}
230		}
231
232		// mPDF 6
233		$c['direction'] = $table['direction'];
234		if (isset($attr['DIR']) && $attr['DIR'] != '') {
235			$c['direction'] = strtolower($attr['DIR']);
236		}
237		if (isset($properties['DIRECTION'])) {
238			$c['direction'] = strtolower($properties['DIRECTION']);
239		}
240
241		if (!$c['a']) {
242			if (isset($c['direction']) && $c['direction'] === 'rtl') {
243				$c['a'] = 'R';
244			} else {
245				$c['a'] = 'L';
246			}
247		}
248
249		$c['cellLineHeight'] = $table['cellLineHeight'];
250		if (isset($properties['LINE-HEIGHT'])) {
251			$c['cellLineHeight'] = $this->mpdf->fixLineheight($properties['LINE-HEIGHT']);
252		}
253
254		$c['cellLineStackingStrategy'] = $table['cellLineStackingStrategy'];
255		if (isset($properties['LINE-STACKING-STRATEGY'])) {
256			$c['cellLineStackingStrategy'] = strtolower($properties['LINE-STACKING-STRATEGY']);
257		}
258
259		$c['cellLineStackingShift'] = $table['cellLineStackingShift'];
260		if (isset($properties['LINE-STACKING-SHIFT'])) {
261			$c['cellLineStackingShift'] = strtolower($properties['LINE-STACKING-SHIFT']);
262		}
263
264		if (isset($properties['TEXT-ROTATE']) && ($properties['TEXT-ROTATE'] || $properties['TEXT-ROTATE'] === '0')) {
265			$c['R'] = $properties['TEXT-ROTATE'];
266		}
267		if (isset($properties['BORDER'])) {
268			$bord = $this->mpdf->border_details($properties['BORDER']);
269			if ($bord['s']) {
270				if (!$this->mpdf->simpleTables) {
271					$c['border'] = Border::ALL;
272					$c['border_details']['R'] = $bord;
273					$c['border_details']['L'] = $bord;
274					$c['border_details']['T'] = $bord;
275					$c['border_details']['B'] = $bord;
276					$c['border_details']['L']['dom'] = $this->mpdf->cell_border_dominance_L;
277					$c['border_details']['R']['dom'] = $this->mpdf->cell_border_dominance_R;
278					$c['border_details']['T']['dom'] = $this->mpdf->cell_border_dominance_T;
279					$c['border_details']['B']['dom'] = $this->mpdf->cell_border_dominance_B;
280				} elseif ($this->mpdf->simpleTables && $this->mpdf->row == 0 && $this->mpdf->col == 0) {
281					$table['simple']['border'] = Border::ALL;
282					$table['simple']['border_details']['R'] = $bord;
283					$table['simple']['border_details']['L'] = $bord;
284					$table['simple']['border_details']['T'] = $bord;
285					$table['simple']['border_details']['B'] = $bord;
286				}
287			}
288		}
289		if (!$this->mpdf->simpleTables) {
290			if (!empty($properties['BORDER-RIGHT'])) {
291				$c['border_details']['R'] = $this->mpdf->border_details($properties['BORDER-RIGHT']);
292				$this->mpdf->setBorder($c['border'], Border::RIGHT, $c['border_details']['R']['s']);
293				$c['border_details']['R']['dom'] = $this->mpdf->cell_border_dominance_R;
294			}
295			if (!empty($properties['BORDER-LEFT'])) {
296				$c['border_details']['L'] = $this->mpdf->border_details($properties['BORDER-LEFT']);
297				$this->mpdf->setBorder($c['border'], Border::LEFT, $c['border_details']['L']['s']);
298				$c['border_details']['L']['dom'] = $this->mpdf->cell_border_dominance_L;
299			}
300			if (!empty($properties['BORDER-BOTTOM'])) {
301				$c['border_details']['B'] = $this->mpdf->border_details($properties['BORDER-BOTTOM']);
302				$this->mpdf->setBorder($c['border'], Border::BOTTOM, $c['border_details']['B']['s']);
303				$c['border_details']['B']['dom'] = $this->mpdf->cell_border_dominance_B;
304			}
305			if (!empty($properties['BORDER-TOP'])) {
306				$c['border_details']['T'] = $this->mpdf->border_details($properties['BORDER-TOP']);
307				$this->mpdf->setBorder($c['border'], Border::TOP, $c['border_details']['T']['s']);
308				$c['border_details']['T']['dom'] = $this->mpdf->cell_border_dominance_T;
309			}
310		} elseif ($this->mpdf->simpleTables && $this->mpdf->row == 0 && $this->mpdf->col == 0) {
311			if (!empty($properties['BORDER-LEFT'])) {
312				$bord = $this->mpdf->border_details($properties['BORDER-LEFT']);
313				if ($bord['s']) {
314					$table['simple']['border'] = Border::ALL;
315				} else {
316					$table['simple']['border'] = 0;
317				}
318				$table['simple']['border_details']['R'] = $bord;
319				$table['simple']['border_details']['L'] = $bord;
320				$table['simple']['border_details']['T'] = $bord;
321				$table['simple']['border_details']['B'] = $bord;
322			}
323		}
324
325		if ($this->mpdf->simpleTables && $this->mpdf->row == 0 && $this->mpdf->col == 0 && !$table['borders_separate'] && $table['simple']['border']) {
326			$table['border_details'] = $table['simple']['border_details'];
327			$table['border'] = $table['simple']['border'];
328		}
329
330		// Border set on TR (if collapsed only)
331		if (!$table['borders_separate'] && !$this->mpdf->simpleTables && isset($table['trborder-left'][$this->mpdf->row])) {
332			if ($this->mpdf->col == 0) {
333				$left = $this->mpdf->border_details($table['trborder-left'][$this->mpdf->row]);
334				$c['border_details']['L'] = $left;
335				$this->mpdf->setBorder($c['border'], Border::LEFT, $c['border_details']['L']['s']);
336			}
337			$c['border_details']['B'] = $this->mpdf->border_details($table['trborder-bottom'][$this->mpdf->row]);
338			$this->mpdf->setBorder($c['border'], Border::BOTTOM, $c['border_details']['B']['s']);
339			$c['border_details']['T'] = $this->mpdf->border_details($table['trborder-top'][$this->mpdf->row]);
340			$this->mpdf->setBorder($c['border'], Border::TOP, $c['border_details']['T']['s']);
341		}
342
343		if ($this->mpdf->packTableData && !$this->mpdf->simpleTables) {
344			$c['borderbin'] = $this->mpdf->_packCellBorder($c);
345			unset($c['border'], $c['border_details']);
346		}
347
348		if (isset($properties['PADDING-LEFT'])) {
349			$c['padding']['L'] = $this->sizeConverter->convert($properties['PADDING-LEFT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false);
350		}
351		if (isset($properties['PADDING-RIGHT'])) {
352			$c['padding']['R'] = $this->sizeConverter->convert($properties['PADDING-RIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false);
353		}
354		if (isset($properties['PADDING-BOTTOM'])) {
355			$c['padding']['B'] = $this->sizeConverter->convert($properties['PADDING-BOTTOM'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false);
356		}
357		if (isset($properties['PADDING-TOP'])) {
358			$c['padding']['T'] = $this->sizeConverter->convert($properties['PADDING-TOP'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false);
359		}
360
361		$w = '';
362		if (isset($properties['WIDTH'])) {
363			$w = $properties['WIDTH'];
364		} elseif (isset($attr['WIDTH'])) {
365			$w = $attr['WIDTH'];
366		}
367		if ($w) {
368			if (strpos($w, '%') && !$this->mpdf->ignore_table_percents) {
369				$c['wpercent'] = (float) $w;
370			} // makes 80% -> 80
371			elseif (!strpos($w, '%') && !$this->mpdf->ignore_table_widths) {
372				$c['w'] = $this->sizeConverter->convert($w, $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false);
373			}
374		}
375
376		if (isset($properties['HEIGHT']) && !strpos($properties['HEIGHT'], '%')) {
377			$c['h'] = $this->sizeConverter->convert($properties['HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false);
378		} elseif (isset($attr['HEIGHT']) && !strpos($attr['HEIGHT'], '%')) {
379			$c['h'] = $this->sizeConverter->convert($attr['HEIGHT'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false);
380		}
381
382		if (isset($properties['WHITE-SPACE'])) {
383			if (strtoupper($properties['WHITE-SPACE']) === 'NOWRAP') {
384				$c['nowrap'] = 1;
385			}
386		}
387
388		if (isset($attr['TEXT-ROTATE'])) {
389			$c['R'] = $attr['TEXT-ROTATE'];
390		}
391		if (!empty($attr['NOWRAP'])) {
392			$c['nowrap'] = 1;
393		}
394
395		$this->mpdf->cell[$this->mpdf->row][$this->mpdf->col] = $c;
396		unset($c);
397		$this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'] = 0;
398
399		$cs = $rs = 1;
400		if (isset($attr['COLSPAN']) && $attr['COLSPAN'] > 1) {
401			$cs = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['colspan'] = $attr['COLSPAN'];
402		}
403		if ($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nc'] < $this->mpdf->col + $cs) {
404			$this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nc'] = $this->mpdf->col + $cs;
405		} // following code moved outside if...
406		for ($l = $this->mpdf->col; $l < $this->mpdf->col + $cs; $l++) {
407			if ($l - $this->mpdf->col) {
408				$this->mpdf->cell[$this->mpdf->row][$l] = 0;
409			}
410		}
411		if (isset($attr['ROWSPAN']) && $attr['ROWSPAN'] > 1) {
412			$rs = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['rowspan'] = $attr['ROWSPAN'];
413		}
414		for ($k = $this->mpdf->row; $k < $this->mpdf->row + $rs; $k++) {
415			for ($l = $this->mpdf->col; $l < $this->mpdf->col + $cs; $l++) {
416				if ($k - $this->mpdf->row || $l - $this->mpdf->col) {
417					$this->mpdf->cell[$k][$l] = 0;
418				}
419			}
420		}
421		unset($table);
422	}
423
424	public function close(&$ahtml, &$ihtml)
425	{
426		if ($this->mpdf->tableLevel) {
427			$this->mpdf->lastoptionaltag = 'TR';
428			unset($this->cssManager->tablecascadeCSS[$this->cssManager->tbCSSlvl]);
429			$this->cssManager->tbCSSlvl--;
430			if (!$this->mpdf->tdbegin) {
431				return;
432			}
433			$this->mpdf->tdbegin = false;
434			// Added for correct calculation of cell column width - otherwise misses the last line if not end </p> etc.
435			if (!isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'])) {
436				if (!is_array($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col])) {
437					throw new \Mpdf\MpdfException('You may have an error in your HTML code e.g. &lt;/td&gt;&lt;/td&gt;');
438				}
439				$this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'];
440			} elseif ($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] < $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s']) {
441				$this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['maxs'] = $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['s'];
442			}
443
444			// Remove last <br> if at end of cell
445			$ntb = 0;
446			if (isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer'])) {
447				$ntb = count($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer']);
448			}
449			if ($ntb > 1 && $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer'][$ntb - 1][0] === "\n") {
450				unset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['textbuffer'][$ntb - 1]);
451			}
452
453			if ($this->mpdf->tablethead) {
454				$this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead'][$this->mpdf->row] = true;
455				if ($this->mpdf->tableLevel == 1) {
456					$this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['headernrows']
457						= max($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['headernrows'], $this->mpdf->row + 1);
458				}
459			}
460			if ($this->mpdf->tabletfoot) {
461				$this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot'][$this->mpdf->row] = true;
462				if ($this->mpdf->tableLevel == 1) {
463					$this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['footernrows']
464						= max(
465							$this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['footernrows'],
466							$this->mpdf->row + 1 - $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['headernrows']
467						);
468				}
469			}
470			$this->mpdf->Reset();
471		}
472	}
473}
474