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