Lines Matching refs:table

542 	var $table;
552 // mPDF 6 Used for table cell (block-type) properties
624 var $original_default_font_size; // used to save default sizes when using table default
1508 $this->table = [];
9245 // This used to resize height to maximum remaining on page ? why. Causes problems when in table and causing a new column
9377 // Used in Columns and keep-with-table i.e. "kwt"
9392 // Still use this method if columns or keep-with-table, as it allows repositioning later
11747 $table = &$this->table[1][1];
11751 $firstrow = count($table['cells']) - $table['footernrows'];
11752 $lastrow = count($table['cells']) - 1;
11755 $lastrow = $table['headernrows'] - 1;
11759 throw new \Mpdf\MpdfException("<tfoot> must precede <tbody> in a table");
11768 if ($table['borders_separate']) {
11769 $adv = $table['border_spacing_V'] / 2 + $table['border_details']['T']['w'] + $table['padding']['T'];
11771 $adv = $table['max_cell_border_width']['T'] / 2;
11873 if ($table['borders_separate']) {
11874 $tablefill = isset($table['bgcolor'][-1]) ? $table['bgcolor'][-1] : 0;
11878 $xadj = ($table['border_spacing_H'] / 2);
11879 $yadj = ($table['border_spacing_V'] / 2);
11880 $wadj = $table['border_spacing_H'];
11881 $hadj = $table['border_spacing_V'];
11883 $yadj += $table['padding']['T'] + $table['border_details']['T']['w'];
11884 $hadj += $table['padding']['T'] + $table['border_details']['T']['w'];
11887 $hadj += $table['padding']['B'] + $table['border_details']['B']['w'];
11890 $xadj += $table['padding']['L'] + $table['border_details']['L']['w'];
11891 $wadj += $table['padding']['L'] + $table['border_details']['L']['w'];
11894 $wadj += $table['padding']['R'] + $table['border_details']['R']['w'];
11903 if ($table['empty_cells'] != 'hide' || !empty($textbuffer) || !$table['borders_separate']) {
11933 if ($table['borders_separate']) {
11936 $this->Rect($x + ($table['border_spacing_H'] / 2), $y + ($table['border_spacing_V'] / 2), $w - $table['border_spacing_H'], $h - $table['border_spacing_V'], 'F');
11938 $this->tableBackgrounds[$level * 9 + $leveladj][] = ['gradient' => false, 'x' => ($x + ($table['border_spacing_H'] / 2)), 'y' => ($y + ($table['border_spacing_V'] / 2)), 'w' => ($w - $table['border_spacing_H']), 'h' => ($h - $table['border_spacing_V']), 'col' => $color];
11956 if ($table['borders_separate']) {
11957 $px = $x + ($table['border_spacing_H'] / 2);
11958 $py = $y + ($table['border_spacing_V'] / 2);
11959 $pw = $w - $table['border_spacing_H'];
11960 $ph = $h - $table['border_spacing_V'];
11979 if ($table['borders_separate']) {
11980 $px = $x + ($table['border_spacing_H'] / 2);
11981 $py = $y + ($table['border_spacing_V'] / 2);
11982 $pw = $w - $table['border_spacing_H'];
11983 $ph = $h - $table['border_spacing_V'];
11998 if ($table['borders_separate']) {
11999 $px = $x + ($table['border_spacing_H'] / 2);
12000 $py = $y + ($table['border_spacing_V'] / 2);
12001 $pw = $w - $table['border_spacing_H'];
12002 $ph = $h - $table['border_spacing_V'];
12026 if ($table['borders_separate'] && $paintcell && $border) {
12027 $this->_tableRect($x + ($table['border_spacing_H'] / 2) + ($border_details['L']['w'] / 2), $y + ($table['border_spacing_V'] / 2) + ($border_details['T']['w'] / 2), $w - $table['border_spacing_H'] - ($border_details['L']['w'] / 2) - ($border_details['R']['w'] / 2), $h - $table['border_spacing_V'] - ($border_details['T']['w'] / 2) - ($border_details['B']['w'] / 2), $border, $border_details, false, $table['borders_separate']);
12029 $this->_tableRect($x, $y, $w, $h, $border, $border_details, true, $table['borders_separate']); // true causes buffer
12114 if ($table['borders_separate']) { // NB twice border width
12115 $xadj = $border_details['L']['w'] + $padding['L'] + ($table['border_spacing_H'] / 2);
12116 $wadj = $border_details['L']['w'] + $border_details['R']['w'] + $padding['L'] + $padding['R'] + $table['border_spacing_H'];
12117 $yadj = $border_details['T']['w'] + $padding['T'] + ($table['border_spacing_H'] / 2);
12134 if (isset($content[$i][0]['trgradients']) && ($colctr == 1 || $table['borders_separate'])) {
12140 $gw = $table['w'] - ($table['max_cell_border_width']['L'] / 2) - ($table['max_cell_border_width']['R'] / 2) - $table['margin']['L'] - $table['margin']['R'];
12141 if ($table['borders_separate']) {
12142 $gw -= ($table['padding']['L'] + $table['border_details']['L']['w'] + $table['padding']['R'] + $table['border_details']['R']['w'] + $table['border_spacing_H']);
12143 $clx = $x + ($table['border_spacing_H'] / 2);
12144 $cly = $y + ($table['border_spacing_V'] / 2);
12145 $clw = $w - $table['border_spacing_H'];
12146 $clh = $h - $table['border_spacing_V'];
12149 $this->tableBackgrounds[$level * 9 + 4][] = ['gradient' => true, 'x' => $gx + ($table['border_spacing_H'] / 2), 'y' => $gy + ($table['border_spacing_V'] / 2), 'w' => $gw - $table['border_spacing_V'], 'h' => $gh - $table['border_spacing_H'], 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => $s];
12156 if (isset($content[$i][0]['trbackground-images']) && ($colctr == 1 || $table['borders_separate'])) {
12163 $gw = $table['w'] - ($table['max_cell_border_width']['L'] / 2) - ($table['max_cell_border_width']['R'] / 2) - $table['margin']['L'] - $table['margin']['R'];
12164 if ($table['borders_separate']) {
12165 $gw -= ($table['padding']['L'] + $table['border_details']['L']['w'] + $table['padding']['R'] + $table['border_details']['R']['w'] + $table['border_spacing_H']);
12166 $clx = $x + ($table['border_spacing_H'] / 2);
12167 $cly = $y + ($table['border_spacing_V'] / 2);
12168 $clw = $w - $table['border_spacing_H'];
12169 $clh = $h - $table['border_spacing_V'];
12172 $this->tableBackgrounds[$level * 9 + 4][] = ['gradient' => true, 'x' => $gx + ($table['border_spacing_H'] / 2), 'y' => $gy + ($table['border_spacing_V'] / 2), 'w' => $gw - $table['border_spacing_V'], 'h' => $gh - $table['border_spacing_H'], 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => $s];
12193 $gw = $table['w'] - ($table['max_cell_border_width']['L'] / 2) - ($table['max_cell_border_width']['R'] / 2) - $table['margin']['L'] - $table['margin']['R'];
12194 if ($table['borders_separate']) {
12195 $gw -= ($table['padding']['L'] + $table['border_details']['L']['w'] + $table['padding']['R'] + $table['border_details']['R']['w'] + $table['border_spacing_H']);
12196 $clx = $x + ($table['border_spacing_H'] / 2);
12197 $cly = $y + ($table['border_spacing_V'] / 2);
12198 $clw = $w - $table['border_spacing_H'];
12199 $clh = $h - $table['border_spacing_V'];
12202 $this->tableBackgrounds[$level * 9 + 5][] = ['x' => $gx + ($table['border_spacing_H'] / 2), 'y' => $gy + ($table['border_spacing_V'] / 2), 'w' => $gw - $table['border_spacing_V'], 'h' => $gh - $table['border_spacing_H'], 'image_id' => $image_id, 'orig_w' => $orig_w, 'orig_h' => $orig_h, 'x_pos' => $x_pos, 'y_pos' => $y_pos, 'x_repeat' => $x_repeat, 'y_repeat' => $y_repeat, 'clippath' => $s, 'resize' => $resize, 'opacity' => $opacity, 'itype' => $itype];
12211 // TABLE BORDER - if separate OR collapsed and only table border
12212 if (($table['borders_separate'] || ($this->simpleTables && !$table['simple']['border'])) && $table['border']) {
12213 $halfspaceL = $table['padding']['L'] + ($table['border_spacing_H'] / 2);
12214 $halfspaceR = $table['padding']['R'] + ($table['border_spacing_H'] / 2);
12215 $halfspaceT = $table['padding']['T'] + ($table['border_spacing_V'] / 2);
12216 $halfspaceB = $table['padding']['B'] + ($table['border_spacing_V'] / 2);
12224 $tby -= $halfspaceT + ($table['border_details']['T']['w'] / 2);
12225 $tbh += $halfspaceT + ($table['border_details']['T']['w'] / 2);
12230 $tbh += $halfspaceB + ($table['border_details']['B']['w'] / 2);
12235 $tbx -= $halfspaceL + ($table['border_details']['L']['w'] / 2);
12236 $tbw += $halfspaceL + ($table['border_details']['L']['w'] / 2);
12241 $tbw += $halfspaceR + ($table['border_details']['R']['w'] / 2);
12245 $this->_tableRect($tbx, $tby, $tbw, $tbh, $tab_bord, $table['border_details'], false, $table['borders_separate'], 'table', $corner, $table['border_spacing_V'], $table['border_spacing_H']);
12250 unset($table);
12543 if ($this->directionality == 'rtl') { // table columns get reversed so need different text-alignment
12551 $html = '<table width="100%" style="border-collapse: collapse; margin: 0; vertical-align: ' . $valign . '; color: #000000; ';
12631 $html .= '</tr></table>';
12727 $oddhtml = '<table width="100%" style="border-collapse: collapse; margin: 0; vertical-align: bottom; color: #000000; ';
12753 $oddhtml .= '</tr></table>';
12755 $evenhtml = '<table width="100%" style="border-collapse: collapse; margin: 0; vertical-align: bottom; color: #000000; ';
12779 $evenhtml .= '</tr></table>';
12872 $oddhtml = '<table width="100%" style="border-collapse: collapse; margin: 0; vertical-align: top; color: #000000; ';
12896 $oddhtml .= '</tr></table>';
12898 $evenhtml = '<table width="100%" style="border-collapse: collapse; margin: 0; vertical-align: top; color: #000000; ';
12924 $evenhtml .= '</tr></table>';
13390 // Don't allow non-breaking spaces that are converted to substituted chars or will break anyway and mess up table width calc.
13590 if (!isset($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs0'])) {
13591 if ($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'] === false) {
13592 $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'] = [];
13594 $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs0'] = $s0;
13596 $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs0'] = max($s0, $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs0']);
13599 if (!isset($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs1'])) {
13600 $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs1'] = $s1;
13602 $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs1'] = max($s1, $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs1']);
13914 // Probably INCOMPATIBLE WITH keep with table, columns etc.
15344 // if position:inside (and NOT table) - output now as a textbuffer; (so if next is block, will move to new line)
15345 // elseif position:outside (and NOT table) - output in front of first textbuffer output by setting listitem (cf. _saveTextBuffer)
15780 // set for kerning via kern table
15843 // set for kerning via kern table
16153 $table = &$this->table[$level][$objattr['table']];
16156 $this->y += $this->table[($level + 1)][$objattr['nestedcontent']]['h']; // nested table height
16159 $cell = &$table['cells'][$objattr['row']][$objattr['col']];
16165 list($dummyx, $w) = $this->_tableGetWidth($table, $objattr['row'], $objattr['col']);
16166 $ntw = $this->table[($level + 1)][$objattr['nestedcontent']]['w']; // nested table width
16174 if ($table['borders_separate']) {
16175 $innerw = $w - $bl - $br - $cell['padding']['L'] - $cell['padding']['R'] - $table['border_spacing_H'];
16180 if ($table['borders_separate']) {
16181 $innerw = $w - $table['simple']['border_details']['L']['w'] - $table['simple']['border_details']['R']['w'] - $cell['padding']['L'] - $cell['padding']['R'] - $table['border_spacing_H'];
16183 $innerw = $w - $table['simple']['border_details']['L']['w'] / 2 - $table['simple']['border_details']['R']['w'] / 2 - $cell['padding']['L'] - $cell['padding']['R'];
16186 if ($cell['a'] == 'C' || $this->table[($level + 1)][$objattr['nestedcontent']]['a'] == 'C') {
16188 } elseif ($cell['a'] == 'R' || $this->table[($level + 1)][$objattr['nestedcontent']]['a'] == 'R') {
16193 $this->_tableWrite($this->table[($level + 1)][$objattr['nestedcontent']]);
16558 $this->SetLineHeight('', $this->table[1][1]['cellLineHeight']); // *TABLES*
18033 if ($this->tableLevel && isset($this->table[1][1]['cellLineHeight'])) {
18034 $this->SetLineHeight('', $this->table[1][1]['cellLineHeight']);
19041 $this->enabledtags = "<a><acronym><address><article><aside><b><bdi><bdo><big><blockquote><br><caption><center><cite><code><del><details><dd><div><dl><dt><em><fieldset><figcaption><figure><font><form><h1><h2><h3><h4><h5><h6><hgroup><hr><i><img><input><ins><kbd><legend><li><main><mark><meter><nav><ol><option><p><pre><progress><q><s><samp><section><select><small><span><strike><strong><sub><summary><sup><table><tbody><td><template><textarea><tfoot><th><thead><time><tr><tt><u><ul><var><footer><header><annotation><bookmark><textcircle><barcode><dottab><indexentry><indexinsert><watermarktext><watermarkimage><tts><ttz><tta><column_break><columnbreak><newcolumn><newpage><page_break><pagebreak><formfeed><columns><toc><tocentry><tocpagebreak><pageheader><pagefooter><setpageheader><setpagefooter><sethtmlpageheader><sethtmlpagefooter>";
19278 throw new \Mpdf\MpdfException("Word is too long to fit in table - " . $this->table_error_report_param);
19287 function shrinkTable(&$table, $k)
19289 $table['border_spacing_H'] /= $k;
19290 $table['border_spacing_V'] /= $k;
19292 $table['padding']['T'] /= $k;
19293 $table['padding']['R'] /= $k;
19294 $table['padding']['B'] /= $k;
19295 $table['padding']['L'] /= $k;
19297 $table['margin']['T'] /= $k;
19298 $table['margin']['R'] /= $k;
19299 $table['margin']['B'] /= $k;
19300 $table['margin']['L'] /= $k;
19302 $table['border_details']['T']['w'] /= $k;
19303 $table['border_details']['R']['w'] /= $k;
19304 $table['border_details']['B']['w'] /= $k;
19305 $table['border_details']['L']['w'] /= $k;
19307 if (isset($table['max_cell_border_width']['T'])) {
19308 $table['max_cell_border_width']['T'] /= $k;
19310 if (isset($table['max_cell_border_width']['R'])) {
19311 $table['max_cell_border_width']['R'] /= $k;
19313 if (isset($table['max_cell_border_width']['B'])) {
19314 $table['max_cell_border_width']['B'] /= $k;
19316 if (isset($table['max_cell_border_width']['L'])) {
19317 $table['max_cell_border_width']['L'] /= $k;
19321 $table['simple']['border_details']['T']['w'] /= $k;
19322 $table['simple']['border_details']['R']['w'] /= $k;
19323 $table['simple']['border_details']['B']['w'] /= $k;
19324 $table['simple']['border_details']['L']['w'] /= $k;
19327 $table['miw'] /= $k;
19328 $table['maw'] /= $k;
19330 for ($j = 0; $j < $table['nc']; $j++) { // columns
19332 $table['wc'][$j]['miw'] = isset($table['wc'][$j]['miw']) ? $table['wc'][$j]['miw'] : 0;
19333 $table['wc'][$j]['maw'] = isset($table['wc'][$j]['maw']) ? $table['wc'][$j]['maw'] : 0;
19335 $table['wc'][$j]['miw'] /= $k;
19336 $table['wc'][$j]['maw'] /= $k;
19338 if (isset($table['decimal_align'][$j]['maxs0']) && $table['decimal_align'][$j]['maxs0']) {
19339 $table['decimal_align'][$j]['maxs0'] /= $k;
19342 if (isset($table['decimal_align'][$j]['maxs1']) && $table['decimal_align'][$j]['maxs1']) {
19343 $table['decimal_align'][$j]['maxs1'] /= $k;
19346 if (isset($table['wc'][$j]['absmiw']) && $table['wc'][$j]['absmiw']) {
19347 $table['wc'][$j]['absmiw'] /= $k;
19350 for ($i = 0; $i < $table['nr']; $i++) { // rows
19352 $c = &$table['cells'][$i][$j];
19525 // table Array of (w, h, bc, nr, wc, hr, cells)
19526 // w Width of table
19527 // h Height of table
19532 // cells List of cells of each rows, cells[i][j] is a cell in the table
19533 function _tableColumnWidth(&$table, $firstpass = false)
19535 $cs = &$table['cells'];
19537 $nc = $table['nc'];
19538 $nr = $table['nr'];
19541 if ($table['borders_separate']) {
19542 $tblbw = $table['border_details']['L']['w'] + $table['border_details']['R']['w'] + $table['margin']['L'] + $table['margin']['R'] + $table['padding']['L'] + $table['padding']['R'] + $table['border_spacing_H'];
19544 $tblbw = $table['max_cell_border_width']['L'] / 2 + $table['max_cell_border_width']['R'] / 2 + $table['margin']['L'] + $table['margin']['R'];
19547 // ADDED table['l'][colno]
19551 $wc = &$table['wc'][$j];
19557 if ($table['borders_separate']) { // NB twice border width
19558 $extrcw = $table['simple']['border_details']['L']['w'] + $table['simple']['border_details']['R']['w'] + $c['padding']['L'] + $c['padding']['R'] + $table['border_spacing_H'];
19560 $extrcw = $table['simple']['border_details']['L']['w'] / 2 + $table['simple']['border_details']['R']['w'] / 2 + $c['padding']['L'] + $c['padding']['R'];
19569 if ($table['borders_separate']) { // NB twice border width
19570 $extrcw = $bl + $br + $c['padding']['L'] + $c['padding']['R'] + $table['border_spacing_H'];
19579 $mw = $table['decimal_align'][$j]['maxs0'] + $table['decimal_align'][$j]['maxs1'] + $extrcw;
19600 if (isset($table['l'][$j])) {
19601 $table['l'][$j] += $c['miw'];
19603 $table['l'][$j] = $c['miw'];
19632 // If minimum width has already been set by a nested table or inline object (image/form), use it
19633 if (isset($c['nestedmiw']) && (!isset($this->table[1][1]['overflow']) || $this->table[1][1]['overflow'] != 'visible')) {
19643 // If maximum width has already been set by a nested table, use it
19650 if (isset($table['overflow']) && $table['overflow'] == 'visible' && $table['level'] == 1) {
19663 $table['wc'][($j + $k)]['wpercent'] = $c['wpercent'] / $c['colspan'];
19666 if (isset($table['w']) && $table['w']) {
19667 $c['w'] = $c['wpercent'] / 100 * ($table['w'] - $tblbw );
19673 if (isset($table['overflow']) && $table['overflow'] == 'visible' && $table['level'] == 1) {
19694 // mPDF 5.7.3 cf. http://www.mpdf1.com/forum/discussion/1648/nested-table-bug-
19714 if (isset($table['l'][$j])) {
19715 $table['l'][$j] += $c['s'];
19717 $table['l'][$j] = $c['s'];
19726 if (isset($table['overflow']) && $table['overflow'] == 'wrap') {
19754 $wc = &$table['wc'];
19766 if (isset($table['l'][$k])) {
19768 $table['l'][$k] += $c['miw'] / $c['colspan'];
19770 $table['l'][$k] += $c['s'] / $c['colspan'];
19774 $table['l'][$k] = $c['miw'] / $c['colspan'];
19776 $table['l'][$k] = $c['s'] / $c['colspan'];
19835 $checkminwidth += $table['wc'][$i]['miw'];
19836 $checkmaxwidth += $table['wc'][$i]['maw'];
19837 $totallength += isset($table['l']) ? $table['l'][$i] : 0;
19840 if (!isset($table['w']) && $firstpass) {
19844 if (isset($table['wc'][$i]['wpercent']) && $table['wc'][$i]['wpercent']) {
19845 $sumpc += $table['wc'][$i]['wpercent'];
19855 if ((!isset($table['wc'][$i]['wpercent']) || !$table['wc'][$i]['wpercent']) &&
19856 (!isset($table['wc'][$i]['w']) || !$table['wc'][$i]['w'])) {
19857 $table['wc'][$i]['wpercent'] = 1;
19877 if (isset($table['wc'][$i]['wpercent'])) {
19878 $maxcalcmiw = max($maxcalcmiw, ($table['wc'][$i]['miw'] * $sumpc / $table['wc'][$i]['wpercent']));
19879 $maxcalcmaw = max($maxcalcmaw, ($table['wc'][$i]['maw'] * $sumpc / $table['wc'][$i]['wpercent']));
19881 $miwleft += $table['wc'][$i]['miw'];
19882 $mawleft += $table['wc'][$i]['maw'];
19883 if (!isset($table['wc'][$i]['w'])) {
19903 if (isset($table['wc'][$i]['wpercent'])) {
19904 $newmiw = $checkminwidth * $table['wc'][$i]['wpercent'] / 100;
19905 if ($table['wc'][$i]['miw'] < $newmiw) {
19906 $table['wc'][$i]['miw'] = $newmiw;
19908 $table['wc'][$i]['w'] = 1;
19909 } elseif ($miwsurplusnonpc && !$table['wc'][$i]['w']) {
19910 $table['wc'][$i]['miw'] += $miwsurplusnonpc / $miwleftcount;
19922 if (isset($table['wc'][$i]['wpercent'])) {
19923 $newmaw = $checkmaxwidth * $table['wc'][$i]['wpercent'] / 100;
19924 if ($table['wc'][$i]['maw'] < $newmaw) {
19925 $table['wc'][$i]['maw'] = $newmaw;
19927 $table['wc'][$i]['w'] = 1;
19928 } elseif ($mawsurplusnonpc && !$table['wc'][$i]['w']) {
19929 $table['wc'][$i]['maw'] += $mawsurplusnonpc / $mawleftcount;
19931 if ($table['wc'][$i]['maw'] < $table['wc'][$i]['miw']) {
19932 $table['wc'][$i]['maw'] = $table['wc'][$i]['miw'];
19942 if (isset($table['wpercent']) && $table['wpercent']) {
19943 $checkminwidth *= (100 / $table['wpercent']);
19944 $checkmaxwidth *= (100 / $table['wpercent']);
19952 if ((isset($table['miw']) && $checkminwidth > $table['miw']) || !isset($table['miw'])) {
19953 $table['miw'] = $checkminwidth;
19955 if ((isset($table['maw']) && $checkmaxwidth > $table['maw']) || !isset($table['maw'])) {
19956 $table['maw'] = $checkmaxwidth;
19958 $table['tl'] = $totallength;
19967 if (!isset($table['overflow'])) {
19968 $table['overflow'] = null;
19971 if ($table['overflow'] == 'visible') {
19973 } elseif ($table['overflow'] == 'hidden' && !$this->table_rotate && !$this->ColActive && $checkminwidth > $mxw) {
19974 $table['w'] = $table['miw'];
19977 // elseif ($table['overflow']=='wrap') { return array(0,0); } // mPDF 6
19979 if (isset($table['w']) && $table['w']) {
19981 if ($table['w'] >= $checkminwidth && $table['w'] <= $mxw) {
19982 $table['maw'] = $mxw = $table['w'];
19983 } elseif ($table['w'] >= $checkminwidth && $table['w'] > $mxw && $this->keep_table_proportions) {
19984 $checkminwidth = $table['w'];
19985 } elseif ($table['w'] < $checkminwidth && $checkminwidth < $mxw && $this->keep_table_proportions) {
19986 $table['maw'] = $table['w'] = $checkminwidth;
19988 unset($table['w']);
20003 function _tableWidth(&$table)
20005 $widthcols = &$table['wc'];
20006 $numcols = $table['nc'];
20009 if ($table['borders_separate']) {
20010 $tblbw = $table['border_details']['L']['w'] + $table['border_details']['R']['w'] + $table['margin']['L'] + $table['margin']['R'] + $table['padding']['L'] + $table['padding']['R'] + $table['border_spacing_H'];
20012 $tblbw = $table['max_cell_border_width']['L'] / 2 + $table['max_cell_border_width']['R'] / 2 + $table['margin']['L'] + $table['margin']['R'];
20015 if ($table['level'] > 1 && isset($table['w'])) {
20017 if (isset($table['wpercent']) && $table['wpercent']) {
20018 $table['w'] = $temppgwidth = (($table['w'] - $tblbw) * $table['wpercent'] / 100) + $tblbw;
20020 $temppgwidth = $table['w'];
20027 // If it is less than 1/20th of the remaining page height to finish the DIV (i.e. DIV padding + table bottom margin) then allow for this
20036 if (isset($table['w']) && $table['w'] < $this->blk[$this->blklvl]['inner_width']) {
20038 $temppgwidth = $table['w'];
20039 } elseif ($table['overflow'] == 'visible' && $table['level'] == 1) {
20041 } elseif ($table['overflow'] == 'hidden' && !$this->ColActive && isset($table['w']) && $table['w'] > $this->blk[$this->blklvl]['inner_width'] && $table['w'] == $table) {
20043 $temppgwidth = $table['w'];
20050 $totaltextlength = 0; // Added - to sum $table['l'][colno]
20051 $totalatextlength = 0; // Added - to sum $table['l'][colno] for those columns where width not set
20063 $totaltextlength += isset($table['l']) ? $table['l'][$i] : 0;
20070 $tablewidth += $tblbw; // Outer half of table borders
20073 $table['w'] = $temppgwidth;
20074 } elseif ($tablewidth < $temppgwidth && !isset($table['w']) && $percentages_set) { // if any widths set as percentages and max width fits < page width
20075 $table['w'] = $table['maw'];
20078 // if table width is set and is > allowed width
20079 if (isset($table['w']) && $table['w'] > $temppgwidth) {
20080 $table['w'] = $temppgwidth;
20083 // IF the table width is now set - Need to distribute columns widths
20085 // If the table width is already set to the maximum width (e.g. nested table), then use maximum column widths exactly
20086 if (isset($table['w']) && ($table['w'] == $tablewidth) && !$percentages_set) {
20093 } elseif (isset($table['w'])) { // elseif the table width is set distribute width using algorithm
20101 if (!isset($widthcols[$i]['w']) || ($widthcols[$i]['w'] && $table['w'] > $temppgwidth && !$this->keep_table_proportions && !$notfullwidth )) {
20104 $totalatextlength += $table['l'][$i];
20114 if ($table['w'] > $wis + $tblbw) {
20117 if ($table['w'] < $temppgwidth || $this->keep_table_proportions) {
20121 $widthcols[$k]['miw'] = ($table['w'] - $tblbw) * $widthcols[$k]['wpercent'] / 100;
20134 $wi = ($table['w'] - ($wis + $tblbw)); // i.e. extra space to distribute
20138 $spareratio = ($table['l'][$k] / $totaltextlength); // gives ratio to divide up free space
20146 $ttl += $table['l'][$k];
20153 $wi = ($table['w'] - ($wis + $tblbw)); // i.e. extra space to distribute
20157 $spareratio = ($table['l'][$k] / $totalatextlength); // gives ratio to divide up free space
20165 $ttl += $table['l'][$k];
20177 $widthcols[$i]['miw'] += $surplus * $table['l'][$i] / $ttl;
20185 $ttl = array_sum($table['l']);
20188 $widthcols[$i]['miw'] += $surplus * $table['l'][$i] / $ttl;
20201 // If sum of column widths set are too wide for table
20228 } else { // table has no width defined
20230 $table['w'] = $tablewidth;
20248 if ($table['overflow'] === 'visible' && $table['level'] == 1) {
20254 for ($i = 0; $i < $table['nr']; $i++) { // rows
20256 if (isset($table['cells'][$i][$j]) && $table['cells'][$i][$j]) {
20258 $colspan = (isset($table['cells'][$i][$j]['colspan']) ? $table['cells'][$i][$j]['colspan'] : 1);
20272 $table['w'] -= $diff;
20273 $table['csp'][$j] = $w - $diff;
20286 if (isset($table['csp'][$i])) {
20287 $w = $table['csp'][$i];
20288 unset($table['csp'][$i]);
20300 $table['colPg'][$i] = $pgNo;
20305 function _tableHeight(&$table)
20307 $level = $table['level'];
20308 $levelid = $table['levelid'];
20309 $cells = &$table['cells'];
20310 $numcols = $table['nc'];
20311 $numrows = $table['nr'];
20328 // If it is less than 1/20th of the remaining page height to finish the DIV (i.e. DIV padding + table bottom margin)
20330 $enddiv = $this->blk[$this->blklvl]['padding_bottom'] + $this->blk[$this->blklvl]['border_bottom']['w'] + $table['margin']['B'];
20350 $heightrow = &$table['hr'][$i];
20356 if ($table['borders_separate']) { // NB twice border width
20357 $extraWLR = ($table['simple']['border_details']['L']['w'] + $table['simple']['border_details']['R']['w']) + ($c['padding']['L'] + $c['padding']['R']) + $table['border_spacing_H'];
20358 $extrh = ($table['simple']['border_details']['T']['w'] + $table['simple']['border_details']['B']['w']) + ($c['padding']['T'] + $c['padding']['B']) + $table['border_spacing_V'];
20360 $extraWLR = ($table['simple']['border_details']['L']['w'] + $table['simple']['border_details']['R']['w']) / 2 + ($c['padding']['L'] + $c['padding']['R']);
20361 $extrh = ($table['simple']['border_details']['T']['w'] + $table['simple']['border_details']['B']['w']) / 2 + ($c['padding']['T'] + $c['padding']['B']);
20372 if ($table['borders_separate']) { // NB twice border width
20373 $extraWLR = $bl + $br + $c['padding']['L'] + $c['padding']['R'] + $table['border_spacing_H'];
20374 $extrh = $bt + $bb + $c['padding']['T'] + $c['padding']['B'] + $table['border_spacing_V'];
20381 if ($table['overflow'] == 'visible' && $level == 1) {
20382 list($x, $cw) = $this->_splitTableGetWidth($table, $i, $j);
20384 list($x, $cw) = $this->_tableGetWidth($table, $i, $j);
20434 if ($table['borders_separate']) {
20436 $extra = $table['margin']['B'] + $table['padding']['B'] + $table['border_details']['B']['w'] + $table['border_spacing_V'] / 2;
20438 $extra = $table['border_spacing_V'] / 2;
20444 $extra = $table['simple']['border_details']['B']['w'] / 2;
20447 if (isset($table['is_thead'][$i]) && $table['is_thead'][$i]) {
20452 } elseif (isset($table['is_tfoot'][$i]) && $table['is_tfoot'][$i]) {
20461 if ($this->tableLevel == 1 && $i == (isset($table['headernrows']) ? $table['headernrows'] : 0)) {
20469 $heightrow = &$table['hr'];
20498 if ($table['borders_separate']) {
20500 $extra = $table['margin']['B'] + $table['padding']['B'] + $table['border_details']['B']['w'] + $table['border_spacing_V'] / 2;
20502 $extra = $table['border_spacing_V'] / 2;
20513 $extra = $table['simple']['border_details']['B']['w'] / 2;
20516 if (!empty($table['is_thead'][$i])) {
20519 } elseif (!empty($table['is_tfoot'][$i])) {
20526 if ($this->tableLevel == 1 && $i == (isset($table['headernrows']) ? $table['headernrows'] : 0)) {
20626 $table['h'] = array_sum($heightrow);
20629 if ($table['borders_separate']) {
20630 $table['h'] += $table['margin']['T'] + $table['margin']['B'] + $table['border_details']['T']['w'] + $table['border_details']['B']['w'] + $table['border_spacing_V'] + $table['padding']['T'] + $table['padding']['B'];
20632 $table['h'] += $table['margin']['T'] + $table['margin']['B'] + $table['max_cell_border_width']['T'] / 2 + $table['max_cell_border_width']['B'] / 2;
20637 return [$table['h'], $maxrowheight, $temppgheight, $remainingpage, $maxfirstrowheight];
20640 function _tableGetWidth(&$table, $i, $j)
20642 $cell = &$table['cells'][$i][$j];
20648 $widthcols = &$table['wc'];
20665 function _splitTableGetWidth(&$table, $i, $j)
20667 $cell = &$table['cells'][$i][$j];
20673 $widthcols = &$table['wc'];
20674 $pg = $table['colPg'][$j];
20676 if ($table['colPg'][$k] == $pg) {
20683 if ($table['colPg'][$k] == $pg) {
20695 function _tableGetHeight(&$table, $i, $j)
20697 $cell = &$table['cells'][$i][$j];
20703 $heightrow = &$table['hr'];
20713 $this->logger->debug('Possible non-wellformed HTML markup in a table', ['context' => LogContext::HTML_MARKUP]);
20724 function _tableGetMaxRowHeight($table, $row)
20726 if ($row == $table['nc'] - 1) {
20727 return $table['hr'][$row];
20729 $maxrowheight = $table['hr'][$row];
20730 for ($i = $row + 1; $i < $table['nr']; $i++) {
20732 for ($j = 0; $j < $table['nc']; $j++) {
20733 if ($table['cells'][$i][$j]) {
20734 if (isset($table['cells'][$i][$j]['colspan'])) {
20735 $cellsset += $table['cells'][$i][$j]['colspan'];
20741 if ($cellsset == $table['nc']) {
20744 $maxrowheight += $table['hr'][$i];
21010 if ($bSeparate && $cort == 'table') {
21105 if ($bSeparate && $cort == 'table') {
21164 if ($bSeparate && $cort == 'table') {
21313 function _fixTableBorders(&$table)
21315 if (!$table['borders_separate'] && $table['border_details']['L']['w']) {
21316 $table['max_cell_border_width']['L'] = $table['border_details']['L']['w'];
21318 if (!$table['borders_separate'] && $table['border_details']['R']['w']) {
21319 $table['max_cell_border_width']['R'] = $table['border_details']['R']['w'];
21321 if (!$table['borders_separate'] && $table['border_details']['T']['w']) {
21322 $table['max_cell_border_width']['T'] = $table['border_details']['T']['w'];
21324 if (!$table['borders_separate'] && $table['border_details']['B']['w']) {
21325 $table['max_cell_border_width']['B'] = $table['border_details']['B']['w'];
21330 $cells = &$table['cells'];
21331 $numcols = $table['nc'];
21332 $numrows = $table['nr'];
21334 if (isset($table['topntail']) && $table['topntail']) {
21335 $tntborddet = $this->border_details($table['topntail']);
21337 if (isset($table['thead-underline']) && $table['thead-underline']) {
21338 $thuborddet = $this->border_details($table['thead-underline']);
21353 if (!$cbord['border'] && $cbord['border'] !== 0 && isset($table['border']) && $table['border'] && $this->table_border_attr_set) {
21354 $cbord['border'] = $table['border'];
21355 $cbord['border_details'] = $table['border_details'];
21371 if ($this->table_border_css_set && !$table['borders_separate']) {
21373 $this->_table2cellBorder($table['border_details']['T'], $cbord['border_details']['T'], $cbord['border'], Border::TOP);
21376 $this->_table2cellBorder($table['border_details']['B'], $cbord['border_details']['B'], $cbord['border'], Border::BOTTOM);
21379 $this->_table2cellBorder($table['border_details']['L'], $cbord['border_details']['L'], $cbord['border'], Border::LEFT);
21382 $this->_table2cellBorder($table['border_details']['R'], $cbord['border_details']['R'], $cbord['border'], Border::RIGHT);
21388 if (isset($table['topntail']) && $table['topntail']) {
21393 if ($this->tableLevel == 1 && $table['headernrows'] > 0 && $i == $table['headernrows'] - 1) {
21397 } elseif ($this->tableLevel == 1 && $table['headernrows'] > 0 && $i == $table['headernrows']) {
21398 if (!$table['borders_separate']) {
21403 if ($this->tableLevel == 1 && $table['footernrows'] > 0 && $i == ($numrows - $table['footernrows'] - 1)) {
21404 if (!$table['borders_separate']) {
21409 } elseif ($this->tableLevel == 1 && $table['footernrows'] > 0 && $i == ($numrows - $table['footernrows'])) {
21414 if (!$table['borders_separate']) {
21424 if (isset($table['thead-underline']) && $table['thead-underline']) {
21425 if ($table['borders_separate']) {
21432 if ($this->tableLevel == 1 && $table['headernrows'] > 0 && $i == $table['headernrows'] - 1) {
21443 // Hidden >> Width >> double>solid>dashed>dotted... >> style set on cell>table >> top/left>bottom/right
21447 if (!$table['borders_separate']) {
21511 } elseif ($celladj['border_details']['T']['dom'] > $celladj['border_details']['B']['dom']) { // Style set on cell vs. table
21518 } else { // Style set on cell vs. table - OR - LEFT/TOP (cell) in preference to BOTTOM/RIGHT
21597 } // Style set on cell vs. table
21603 } // Style set on cell vs. table - OR - LEFT/TOP (cell) in preference to BOTTOM/RIGHT
21628 if (!$table['borders_separate']) {
21799 // Update maximum cell border width at LRTB edges of table - used for overall table width
21801 $table['max_cell_border_width']['L'] = max($table['max_cell_border_width']['L'], $cbord['border_details']['L']['w']);
21804 $table['max_cell_border_width']['R'] = max($table['max_cell_border_width']['R'], $cbord['border_details']['R']['w']);
21807 $table['max_cell_border_width']['T'] = max($table['max_cell_border_width']['T'], $cbord['border_details']['T']['w']);
21810 $table['max_cell_border_width']['B'] = max($table['max_cell_border_width']['B'], $cbord['border_details']['B']['w']);
21830 function _reverseTableDir(&$table)
21832 $cells = &$table['cells'];
21833 $numcols = $table['nc'];
21834 $numrows = $table['nr'];
21852 $this->table[($this->tableLevel + 1)][$objattr['nestedcontent']]['nestedpos'][1] = $col;
21865 $table['cells'][$i] = $row;
21869 function _tableWrite(&$table, $split = false, $startrow = 0, $startcol = 0, $splitpg = 0, $rety = 0)
21871 $level = $table['level'];
21872 $levelid = $table['levelid'];
21874 $cells = &$table['cells'];
21875 $numcols = $table['nc'];
21876 $numrows = $table['nr'];
21884 if ($table['margin']['T']) {
21886 $this->DivLn($table['margin']['T'], $this->blklvl, true, 1); // collapsible
21888 $this->y += ($table['margin']['T']);
21892 if ($table['borders_separate']) {
21893 if ($startrow > 0 && (!isset($table['is_thead']) || count($table['is_thead']) == 0)) {
21894 $adv = $table['border_spacing_V'] / 2;
21896 $adv = $table['padding']['T'] + $table['border_details']['T']['w'] + $table['border_spacing_V'] / 2;
21899 $adv = $table['max_cell_border_width']['T'] / 2;
21919 $right = $x0 + $table['w'];
21926 $this->tbrot_y0 = $this->y - $adv - $table['margin']['T'];
21928 $this->tbrot_w = $table['w'];
21929 if ($table['borders_separate']) {
21930 $this->tbrot_h = $table['margin']['T'] + $table['padding']['T'] + $table['border_details']['T']['w'] + $table['border_spacing_V'] / 2;
21932 $this->tbrot_h = $table['margin']['T'] + $table['padding']['T'] + $table['max_cell_border_width']['T'];
21939 if (isset($table['a']) and ( $table['w'] < $this->blk[$this->blklvl]['inner_width'])) {
21940 if ($table['a'] == 'C') {
21941 $x0 += ((($right - $x0) - $table['w']) / 2);
21942 } elseif ($table['a'] == 'R') {
21943 $x0 = $right - $table['w'];
21947 $temppgwidth = $table['w'];
21950 if (!isset($table['overflow'])) {
21951 $table['overflow'] = null;
21953 if ($table['overflow'] == 'hidden' && $level == 1 && !$this->table_rotate && !$this->ColActive) {
21962 if ($table['borders_separate']) {
21963 $indent = $table['margin']['L'] + $table['border_details']['L']['w'] + $table['padding']['L'] + $table['border_spacing_H'] / 2;
21965 $indent = $table['margin']['L'] + $table['max_cell_border_width']['L'] / 2;
21977 // mPD 3.0 Set the Page & Column where table starts
21993 if (isset($table['is_tfoot'][$i]) && $table['is_tfoot'][$i] && $level == 1) {
21994 $tablefooterrowheight += $table['hr'][$i];
21995 $tablefooter[$i][0]['trbackground-images'] = $table['trbackground-images'][$i];
21996 $tablefooter[$i][0]['trgradients'] = $table['trgradients'][$i];
21997 $tablefooter[$i][0]['trbgcolor'] = $table['bgcolor'][$i];
22002 if ($table['colPg'][$j] != $splitpg) {
22005 list($x, $w) = $this->_splitTableGetWidth($table, $i, $j);
22008 list($x, $w) = $this->_tableGetWidth($table, $i, $j);
22012 list($y, $h) = $this->_tableGetHeight($table, $i, $j);
22015 // Get info of tfoot ==>> table footer
22047 $tablefooter[$i][$js]['border'] = $table['simple']['border'];
22048 $tablefooter[$i][$js]['border_details'] = $table['simple']['border_details'];
22086 $thnr = (isset($table['is_thead']) ? count($table['is_thead']) : 0);
22096 $maxrowheight = $this->_tableGetMaxRowHeight($table, $i);
22102 if ($table['colPg'][$j] > $splitpg) {
22111 list($x, $w) = $this->_splitTableGetWidth($table, $i, $j);
22113 list($x, $w) = $this->_tableGetWidth($table, $i, $j);
22116 list($y, $h) = $this->_tableGetHeight($table, $i, $j);
22121 if ($table['borders_separate']) {
22123 $extra = $table['padding']['B'] + $table['border_details']['B']['w'] + $table['border_spacing_V'] / 2;
22124 // $extra = $table['margin']['B'] + $table['padding']['B'] + $table['border_details']['B']['w'] + $table['border_spacing_V']/2;
22126 $extra = $table['border_spacing_V'] / 2;
22129 $extra = $table['max_cell_border_width']['B'] / 2;
22132 if ($j == $startcol && ((($y + $maxrowheight + $extra ) > ($pagetrigger + 0.001)) || (($this->keepColumns || !$this->ColActive) && !empty($tablefooter) && ($y + $maxrowheight + $tablefooterrowheight + $extra) > $pagetrigger) && ($this->tableLevel == 1 && $i < ($numrows - $table['headernrows']))) && ($y0 > 0 || $x0 > 0) && !$this->InFooter && $this->autoPageBreak) {
22139 if ($table['colPg'][$t] > $splitpg) {
22169 if ($table['borders_separate']) {
22170 $adv = $table['border_spacing_V'] / 2;
22171 // If table footer
22173 $adv += ($table['padding']['B'] + $table['border_details']['B']['w']);
22180 $maxbwbottom = $table['max_cell_border_width']['B'];
22195 $maxbwtop = $table['max_cell_border_width']['T'];
22210 $maxbwtop = $table['simple']['border_details']['T']['w'];
22211 $maxbwbottom = $table['simple']['border_details']['B']['w'];
22218 // Rotated table split over pages - needs this->y for borders/backgrounds
22230 if ($table['borders_separate']) {
22231 $bx -= ($table['padding']['L'] + $table['border_details']['L']['w'] + $table['border_spacing_H'] / 2);
22233 $by += $table['max_cell_border_width']['T'] / 2;
22235 $by -= ($table['border_spacing_V'] / 2);
22238 $by -= ($table['padding']['T'] + $table['border_details']['T']['w'] + $table['border_spacing_V'] / 2);
22246 if (!$table['borders_separate']) {
22252 if ($table['colPg'][$t] == $splitpg) {
22253 $bw += $table['wc'][$t];
22255 if ($table['colPg'][$t] > $splitpg) {
22259 if ($table['borders_separate']) {
22261 $bw += $table['padding']['L'] + $table['border_details']['L']['w'] + $table['border_spacing_H'];
22263 $bx += ($table['padding']['L'] + $table['border_details']['L']['w']);
22264 $bw += $table['border_spacing_H'];
22267 $bw += $table['padding']['R'] + $table['border_details']['R']['w'] / 2 + $table['border_spacing_H'];
22271 $bw = $table['w'] - ($table['max_cell_border_width']['L'] / 2) - ($table['max_cell_border_width']['R'] / 2) - $table['margin']['L'] - $table['margin']['R'];
22274 if ($this->splitTableBorderWidth && ($this->keepColumns || !$this->ColActive) && empty($tablefooter) && $i > 0 && $table['border_details']['B']['w']) {
22278 $this->SetDColor($table['border_details']['B']['c']);
22283 if (!$table['borders_separate']) {
22284 $blx -= ($table['max_cell_border_width']['L'] / 2);
22285 $blw += ($table['max_cell_border_width']['L'] / 2 + $table['max_cell_border_width']['R'] / 2);
22296 if (isset($table['bgcolor'][-1])) {
22297 $color = $this->colorConverter->convert($table['bgcolor'][-1], $this->PDFAXwarnings);
22299 if (!$table['borders_separate']) {
22300 $bh -= $table['max_cell_border_width']['B'] / 2;
22307 if (isset($table['gradient'])) {
22308 $g = $this->gradient->parseBackgroundGradient($table['gradient']);
22314 if (isset($table['background-image'])) {
22315 if ($table['background-image']['gradient'] && preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient/', $table['background-image']['gradient'])) {
22316 $g = $this->gradient->parseMozGradient($table['background-image']['gradient']);
22321 $image_id = $table['background-image']['image_id'];
22322 $orig_w = $table['background-image']['orig_w'];
22323 $orig_h = $table['background-image']['orig_h'];
22324 $x_pos = $table['background-image']['x_pos'];
22325 $y_pos = $table['background-image']['y_pos'];
22326 $x_repeat = $table['background-image']['x_repeat'];
22327 $y_repeat = $table['background-image']['y_repeat'];
22328 $resize = $table['background-image']['resize'];
22329 $opacity = $table['background-image']['opacity'];
22330 $itype = $table['background-image']['itype'];
22378 if ($this->splitTableBorderWidth && ($this->keepColumns || !$this->ColActive) && empty($tableheader) && $i > 0 && $table['border_details']['T']['w']) {
22382 $this->SetDColor($table['border_details']['T']['c']);
22396 if ($i > 0 && !$this->table_rotate && $level == 1 && $table['headernrows'] == 0) {
22397 if ($table['borders_separate']) {
22398 $adv = $table['border_spacing_V'] / 2;
22411 $maxbwtop = max($maxbwtop, $table['simple']['border_details']['T']['w']);
22423 if ($table['borders_separate']) {
22424 $this->tbrot_h = $table['margin']['T'] + $table['padding']['T'] + $table['border_details']['T']['w'] + $table['border_spacing_V'] / 2;
22426 $this->tbrot_h = $table['margin']['T'] + $table['max_cell_border_width']['T'];
22448 if ($table['borders_separate']) {
22449 $adv = $table['border_spacing_V'] / 2 + $table['border_details']['T']['w'] + $table['padding']['T'];
22451 $adv = $table['max_cell_border_width']['T'] / 2;
22504 // Set the Page & Column where table actually starts
22532 if ($table['borders_separate']) {
22533 $adv = $table['margin']['B'] + $table['padding']['B'] + $table['border_details']['B']['w'] + $table['border_spacing_V'] / 2;
22535 $adv = $table['margin']['B'] + $table['max_cell_border_width']['B'] / 2;
22564 if ($table['borders_separate']) {
22565 $fill = isset($table['bgcolor'][-1]) ? $table['bgcolor'][-1] : 0;
22569 $xadj = ($table['border_spacing_H'] / 2);
22570 $yadj = ($table['border_spacing_V'] / 2);
22571 $wadj = $table['border_spacing_H'];
22572 $hadj = $table['border_spacing_V'];
22574 $yadj += $table['padding']['T'] + $table['border_details']['T']['w'];
22575 $hadj += $table['padding']['T'] + $table['border_details']['T']['w'];
22578 $xadj += $table['padding']['L'] + $table['border_details']['L']['w'];
22579 $wadj += $table['padding']['L'] + $table['border_details']['L']['w'];
22582 $hadj += $table['padding']['B'] + $table['border_details']['B']['w'];
22585 $wadj += $table['padding']['R'] + $table['border_details']['R']['w'];
22595 if ($table['empty_cells'] != 'hide' || !empty($cell['textbuffer']) || (isset($cell['nestedcontent']) && $cell['nestedcontent']) || !$table['borders_separate']) {
22615 $bord = $table['simple']['border'];
22616 $bord_det = $table['simple']['border_details'];
22624 } elseif (isset($table['bgcolor'][$i]) && $table['bgcolor'][$i] && $table['bgcolor'][$i] != 'transparent') { // Row color
22625 $fill = $table['bgcolor'][$i];
22631 if ($table['borders_separate']) {
22634 $this->Rect($x + ($table['border_spacing_H'] / 2), $y + ($table['border_spacing_V'] / 2), $w - $table['border_spacing_H'], $h - $table['border_spacing_V'], 'F');
22636 $this->tableBackgrounds[$level * 9 + $leveladj][] = ['gradient' => false, 'x' => ($x + ($table['border_spacing_H'] / 2)), 'y' => ($y + ($table['border_spacing_V'] / 2)), 'w' => ($w - $table['border_spacing_H']), 'h' => ($h - $table['border_spacing_V']), 'col' => $color];
22653 if ($table['borders_separate']) {
22654 $px = $x + ($table['border_spacing_H'] / 2);
22655 $py = $y + ($table['border_spacing_V'] / 2);
22656 $pw = $w - $table['border_spacing_H'];
22657 $ph = $h - $table['border_spacing_V'];
22676 if ($table['borders_separate']) {
22677 $px = $x + ($table['border_spacing_H'] / 2);
22678 $py = $y + ($table['border_spacing_V'] / 2);
22679 $pw = $w - $table['border_spacing_H'];
22680 $ph = $h - $table['border_spacing_V'];
22695 if ($table['borders_separate']) {
22696 $px = $x + ($table['border_spacing_H'] / 2);
22697 $py = $y + ($table['border_spacing_V'] / 2);
22698 $pw = $w - $table['border_spacing_H'];
22699 $ph = $h - $table['border_spacing_V'];
22745 if (!$table['borders_separate'] && $this->tabletheadjustfinished && !$this->simpleTables) {
22746 if (isset($table['topntail']) && $table['topntail']) {
22747 $bord_det['T'] = $this->border_details($table['topntail']);
22751 if (isset($table['thead-underline']) && $table['thead-underline']) {
22752 $bord_det['T'] = $this->border_details($table['thead-underline']);
22759 // Get info of first row ==>> table header
22761 if (isset($table['is_thead'][$i]) && $table['is_thead'][$i] && $level == 1) {
22763 $tableheaderrowheight += $table['hr'][$i];
22765 $tableheader[$i][0]['trbackground-images'] = (isset($table['trbackground-images'][$i]) ? $table['trbackground-images'][$i] : null);
22766 $tableheader[$i][0]['trgradients'] = (isset($table['trgradients'][$i]) ? $table['trgradients'][$i] : null);
22767 $tableheader[$i][0]['trbgcolor'] = (isset($table['bgcolor'][$i]) ? $table['bgcolor'][$i] : null);
22792 $tableheader[$i][$j]['border'] = $table['simple']['border'];
22793 $tableheader[$i][$j]['border_details'] = $table['simple']['border_details'];
22812 if ($table['borders_separate'] && $paintcell) {
22813 $this->_tableRect($x + ($table['border_spacing_H'] / 2) + ($bord_det['L']['w'] / 2), $y + ($table['border_spacing_V'] / 2) + ($bord_det['T']['w'] / 2), $w - $table['border_spacing_H'] - ($bord_det['L']['w'] / 2) - ($bord_det['R']['w'] / 2), $h - $table['border_spacing_V'] - ($bord_det['T']['w'] / 2) - ($bord_det['B']['w'] / 2), $bord, $bord_det, false, $table['borders_separate']);
22814 } elseif (!$table['borders_separate']) {
22815 $this->_tableRect($x, $y, $w, $h, $bord, $bord_det, true, $table['borders_separate']); // true causes buffer
22839 if (isset($table['is_tfoot'][$i]) && $table['is_tfoot'][$i]) {
22844 } elseif (!isset($table['is_thead'][$i])) {
22887 $this->x += ($w) + ($offset) - ($cellFontHeight / 3) - ($cell['padding']['R'] + ($table['border_spacing_H'] / 2));
22891 $this->x += ($offset) + ($cellFontHeight / 3) + ($cell['padding']['L'] + ($table['border_spacing_H'] / 2));
22903 $this->y += (($h - $cell['mih']) / 2) + ($cell['padding']['T'] + ($table['border_spacing_V'] / 2));
22908 $this->y += $h - ($cell['padding']['B'] + ($table['border_spacing_V'] / 2));
22910 $this->y += $h - $cell['mih'] + ($cell['padding']['T'] + ($table['border_spacing_V'] / 2));
22914 $this->y += $cell['mih'] - ($cell['padding']['B'] + ($table['border_spacing_V'] / 2));
22916 $this->y += ($cell['padding']['T'] + ($table['border_spacing_V'] / 2));
22946 if ($table['borders_separate']) {
22947 $xadj = $btlw + $cell['padding']['L'] + ($table['border_spacing_H'] / 2);
22948 $wadj = $btlw + $btrw + $cell['padding']['L'] + $cell['padding']['R'] + $table['border_spacing_H'];
22949 $yadj = $bttw + $cell['padding']['T'] + ($table['border_spacing_H'] / 2);
22956 if ($table['borders_separate']) { // NB twice border width
22957 $xadj = $table['simple']['border_details']['L']['w'] + $cell['padding']['L'] + ($table['border_spacing_H'] / 2);
22958 $wadj = $table['simple']['border_details']['L']['w'] + $table['simple']['border_details']['R']['w'] + $cell['padding']['L'] + $cell['padding']['R'] + $table['border_spacing_H'];
22959 $yadj = $table['simple']['border_details']['T']['w'] + $cell['padding']['T'] + ($table['border_spacing_H'] / 2);
22961 $xadj = $table['simple']['border_details']['L']['w'] / 2 + $cell['padding']['L'];
22962 $wadj = ($table['simple']['border_details']['L']['w'] + $table['simple']['border_details']['R']['w']) / 2 + $cell['padding']['L'] + $cell['padding']['R'];
22963 $yadj = $table['simple']['border_details']['T']['w'] / 2 + $cell['padding']['T'];
22971 $smax = $table['decimal_align'][$j]['maxs0'];
22972 $d_content = $table['decimal_align'][$j]['maxs0'] + $table['decimal_align'][$j]['maxs1'];
22997 if (isset($table['trgradients'][$i]) && ($j == 0 || $table['borders_separate'])) {
22998 $g = $this->gradient->parseBackgroundGradient($table['trgradients'][$i]);
23003 $gw = $table['w'] - ($table['max_cell_border_width']['L'] / 2) - ($table['max_cell_border_width']['R'] / 2) - $table['margin']['L'] - $table['margin']['R'];
23004 if ($table['borders_separate']) {
23005 $gw -= ($table['padding']['L'] + $table['border_details']['L']['w'] + $table['padding']['R'] + $table['border_details']['R']['w'] + $table['border_spacing_H']);
23006 $clx = $x + ($table['border_spacing_H'] / 2);
23007 $cly = $y + ($table['border_spacing_V'] / 2);
23008 $clw = $w - $table['border_spacing_H'];
23009 $clh = $h - $table['border_spacing_V'];
23012 $this->tableBackgrounds[$level * 9 + 4][] = ['gradient' => true, 'x' => $gx + ($table['border_spacing_H'] / 2), 'y' => $gy + ($table['border_spacing_V'] / 2), 'w' => $gw - $table['border_spacing_V'], 'h' => $gh - $table['border_spacing_H'], 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => $s];
23018 if (isset($table['trbackground-images'][$i]) && ($j == 0 || $table['borders_separate'])) {
23019 if (isset($table['trbackground-images'][$i]['gradient']) && preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient/', $table['trbackground-images'][$i]['gradient'])) {
23020 $g = $this->gradient->parseMozGradient($table['trbackground-images'][$i]['gradient']);
23025 $gw = $table['w'] - ($table['max_cell_border_width']['L'] / 2) - ($table['max_cell_border_width']['R'] / 2) - $table['margin']['L'] - $table['margin']['R'];
23026 if ($table['borders_separate']) {
23027 $gw -= ($table['padding']['L'] + $table['border_details']['L']['w'] + $table['padding']['R'] + $table['border_details']['R']['w'] + $table['border_spacing_H']);
23028 $clx = $x + ($table['border_spacing_H'] / 2);
23029 $cly = $y + ($table['border_spacing_V'] / 2);
23030 $clw = $w - $table['border_spacing_H'];
23031 $clh = $h - $table['border_spacing_V'];
23034 $this->tableBackgrounds[$level * 9 + 4][] = ['gradient' => true, 'x' => $gx + ($table['border_spacing_H'] / 2), 'y' => $gy + ($table['border_spacing_V'] / 2), 'w' => $gw - $table['border_spacing_V'], 'h' => $gh - $table['border_spacing_H'], 'gradtype' => $g['type'], 'stops' => $g['stops'], 'colorspace' => $g['colorspace'], 'coords' => $g['coords'], 'extend' => $g['extend'], 'clippath' => $s];
23040 $image_id = $table['trbackground-images'][$i]['image_id'];
23041 $orig_w = $table['trbackground-images'][$i]['orig_w'];
23042 $orig_h = $table['trbackground-images'][$i]['orig_h'];
23043 $x_pos = $table['trbackground-images'][$i]['x_pos'];
23044 $y_pos = $table['trbackground-images'][$i]['y_pos'];
23045 $x_repeat = $table['trbackground-images'][$i]['x_repeat'];
23046 $y_repeat = $table['trbackground-images'][$i]['y_repeat'];
23047 $resize = $table['trbackground-images'][$i]['resize'];
23048 $opacity = $table['trbackground-images'][$i]['opacity'];
23049 $itype = $table['trbackground-images'][$i]['itype'];
23054 $gw = $table['w'] - ($table['max_cell_border_width']['L'] / 2) - ($table['max_cell_border_width']['R'] / 2) - $table['margin']['L'] - $table['margin']['R'];
23055 if ($table['borders_separate']) {
23056 $gw -= ($table['padding']['L'] + $table['border_details']['L']['w'] + $table['padding']['R'] + $table['border_details']['R']['w'] + $table['border_spacing_H']);
23057 $clx = $x + ($table['border_spacing_H'] / 2);
23058 $cly = $y + ($table['border_spacing_V'] / 2);
23059 $clw = $w - $table['border_spacing_H'];
23060 $clh = $h - $table['border_spacing_V'];
23063 $this->tableBackgrounds[$level * 9 + 5][] = ['x' => $gx + ($table['border_spacing_H'] / 2), 'y' => $gy + ($table['border_spacing_V'] / 2), 'w' => $gw - $table['border_spacing_V'], 'h' => $gh - $table['border_spacing_H'], 'image_id' => $image_id, 'orig_w' => $orig_w, 'orig_h' => $orig_h, 'x_pos' => $x_pos, 'y_pos' => $y_pos, 'x_repeat' => $x_repeat, 'y_repeat' => $y_repeat, 'clippath' => $s, 'resize' => $resize, 'opacity' => $opacity, 'itype' => $itype];
23074 if (($table['borders_separate'] || ($this->simpleTables && !$table['simple']['border'])) && $table['border']) {
23075 $halfspaceL = $table['padding']['L'] + ($table['border_spacing_H'] / 2);
23076 $halfspaceR = $table['padding']['R'] + ($table['border_spacing_H'] / 2);
23077 $halfspaceT = $table['padding']['T'] + ($table['border_spacing_V'] / 2);
23078 $halfspaceB = $table['padding']['B'] + ($table['border_spacing_V'] / 2);
23087 $tby -= $halfspaceT + ($table['border_details']['T']['w'] / 2);
23088 $tbh += $halfspaceT + ($table['border_details']['T']['w'] / 2);
23093 $tbh += $halfspaceB + ($table['border_details']['B']['w'] / 2);
23098 $tbx -= $halfspaceL + ($table['border_details']['L']['w'] / 2);
23099 $tbw += $halfspaceL + ($table['border_details']['L']['w'] / 2);
23104 $tbw += $halfspaceR + ($table['border_details']['R']['w'] / 2);
23108 $this->_tableRect($tbx, $tby, $tbw, $tbh, $tab_bord, $table['border_details'], false, $table['borders_separate'], 'table', $corner, $table['border_spacing_V'], $table['border_spacing_H']);
23150 if ($table['borders_separate']) {
23151 $this->y += $table['padding']['B'] + $table['border_details']['B']['w'] + $table['border_spacing_V'] / 2;
23153 $this->y += $table['max_cell_border_width']['B'] / 2;
23156 if ($table['borders_separate'] && $level == 1) {
23157 $this->tbrot_h += $table['margin']['B'] + $table['padding']['B'] + $table['border_details']['B']['w'] + $table['border_spacing_V'] / 2;
23159 $this->tbrot_h += $table['margin']['B'] + $table['max_cell_border_width']['B'] / 2;
23164 if ($table['borders_separate']) {
23165 $bx -= ($table['padding']['L'] + $table['border_details']['L']['w'] + $table['border_spacing_H'] / 2);
23167 $by += $table['max_cell_border_width']['T'] / 2;
23169 $by -= ($table['border_spacing_V'] / 2);
23172 $by -= ($table['border_spacing_V'] / 2);
23174 $by -= ($table['padding']['T'] + $table['border_details']['T']['w'] + $table['border_spacing_V'] / 2);
23181 if (!$table['borders_separate']) {
23182 $bh -= $table['max_cell_border_width']['B'] / 2;
23189 if ($table['colPg'][$t] == $splitpg) {
23190 $bw += $table['wc'][$t];
23192 if ($table['colPg'][$t] > $splitpg) {
23202 if ($table['borders_separate']) {
23203 $bw += $table['border_spacing_H'];
23205 $bw += $table['padding']['L'] + $table['border_details']['L']['w'];
23207 $bx += ($table['padding']['L'] + $table['border_details']['L']['w']);
23210 $bw += $table['padding']['R'] + $table['border_details']['R']['w'];
23214 $bw = $table['w'] - ($table['max_cell_border_width']['L'] / 2) - ($table['max_cell_border_width']['R'] / 2) - $table['margin']['L'] - $table['margin']['R'];
23218 if (isset($table['bgcolor'][-1])) {
23219 $color = $this->colorConverter->convert($table['bgcolor'][-1], $this->PDFAXwarnings);
23226 if (isset($table['gradient'])) {
23227 $g = $this->gradient->parseBackgroundGradient($table['gradient']);
23233 if (isset($table['background-image'])) {
23234 if (isset($table['background-image']['gradient']) && $table['background-image']['gradient'] && preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient/', $table['background-image']['gradient'])) {
23235 $g = $this->gradient->parseMozGradient($table['background-image']['gradient']);
23240 $image_id = $table['background-image']['image_id'];
23241 $orig_w = $table['background-image']['orig_w'];
23242 $orig_h = $table['background-image']['orig_h'];
23243 $x_pos = $table['background-image']['x_pos'];
23244 $y_pos = $table['background-image']['y_pos'];
23245 $x_repeat = $table['background-image']['x_repeat'];
23246 $y_repeat = $table['background-image']['y_repeat'];
23247 $resize = $table['background-image']['resize'];
23248 $opacity = $table['background-image']['opacity'];
23249 $itype = $table['background-image']['itype'];
23279 if ($table['margin']['B']) {
23281 $this->DivLn($table['margin']['B'], $this->blklvl, true); // collapsible
23283 $this->y += ($table['margin']['B']);
25143 * Keep-with-table This buffers contents of h1-6 to keep on page with table
26158 $size /= $k; // in case resized in a table
26502 $size /= $k; // in case resized in a table
27006 $html = preg_replace('/<table[^>]*>\s*<\/table>/i', '', $html);
27008 // Remove spaces at end of table cells
27109 $html = preg_replace('/(<table[^>]*>)\s*(<caption)(.*?<\/caption>)(.*?<\/table>)/si', '\\2 position="top"\\3\\1\\4\\2 position="bottom"\\3', $html); // *TABLES*
27110 $html = preg_replace('/<(h[1-6])([^>]*)(>(?:(?!h[1-6]).)*?<\/\\1>\s*<table)/si', '<\\1\\2 keep-with-table="1"\\3', $html); // *TABLES*