public function table($data = [], $width = [], $align = [], $header = [], $level = 0, $prevHeader = '', $prevLevel = 0) {
		if (empty($data)) {
			$subHeader = __d('view_extension', 'No data to display');
			$this->_createSubHeader($subHeader, $width, 0);
			$this->tcpdf->Bookmark($subHeader, 0, 0, '', 'B', [0, 0, 0]);

			return;
		}

		if (empty($header) || empty($width)) {
			return;
		}

		if (empty($align)) {
			$align = [];
		}

		foreach ($data as $subHeader => $rows) {
			if (!isAssoc($rows)) {
				if ($this->_getFlagUseNonBreakingCells()) {
					$this->tcpdf->setAutoPageBreak(false);
					$this->tcpdf->startTransaction();
				}
				if (!empty($prevHeader)) {
					$this->_createSubHeader($prevHeader, $width, $prevLevel);
					$this->tcpdf->Bookmark(strip_tags($prevHeader), $prevLevel, 0, '', 'B', [0, 64, 128]);
				}
				if (!empty($subHeader)) {
					$this->_createSubHeader($subHeader, $width, $level);
					$this->tcpdf->Bookmark(strip_tags($subHeader), $level, 0, '', 'B', [0, 64, 128]);
				}
				$this->_createTableHeader($header, $width);
				$this->_createTableRows(
					$rows,
					$width,
					$align,
					$header,
					$subHeader,
					$level,
					$prevHeader,
					$prevLevel
				);
				if (!empty($prevHeader)) {
					$prevHeader = '';
				}
			} else {
				$subLevel = $level + 1;
				$this->table($rows, $width, $align, $header, $subLevel, $subHeader, $level);
			}

			$y = $this->tcpdf->GetY();
			$y += (12 / ($level + 1));
			$this->tcpdf->SetY($y);
		}
	}
public function table($data = [], $width = [], $align = [], $header = [], $level = 0, $prevHeader = '', $prevLevel = 0) {
		if (empty($data)) {
			$subHeader = __d('view_extension', 'No data to display');
			$this->_createSubHeader($subHeader, $width, 0);
			$this->tcpdf->Bookmark($subHeader, 0, 0, '', 'B', [0, 0, 0]);

			return;
		}

		if (empty($header) || empty($width)) {
			return;
		}

		if (empty($align)) {
			$align = [];
		}

		foreach ($data as $subHeader => $rows) {
			if (!isAssoc($rows)) {
				if ($this->_getFlagUseNonBreakingCells()) {
					$this->tcpdf->setAutoPageBreak(false);
					$this->tcpdf->startTransaction();
				}
				if (!empty($prevHeader)) {
					$this->_createSubHeader($prevHeader, $width, $prevLevel);
					$this->tcpdf->Bookmark(strip_tags($prevHeader), $prevLevel, 0, '', 'B', [0, 64, 128]);
				}
				if (!empty($subHeader)) {
					$this->_createSubHeader($subHeader, $width, $level);
					$this->tcpdf->Bookmark(strip_tags($subHeader), $level, 0, '', 'B', [0, 64, 128]);
				}
				$this->_createTableHeader($header, $width);
				$this->_createTableRows(
					$rows,
					$width,
					$align,
					$header,
					$subHeader,
					$level,
					$prevHeader,
					$prevLevel
				);
				if (!empty($prevHeader)) {
					$prevHeader = '';
				}
			} else {
				$subLevel = $level + 1;
				$this->table($rows, $width, $align, $header, $subLevel, $subHeader, $level);
			}

			$y = $this->tcpdf->GetY();
			$y += (12 / ($level + 1));
			$this->tcpdf->SetY($y);
		}
	}
public function table ( $ data = [ ] , $ width = [ ] , $ align = [ ] , $ header = [ ] , $ level = 0 , $ prevHeader = '' , $ prevLevel = 0 ) { if ( empty ( $ data ) ) { $ subHeader = __d ( 'view_extension' , 'No data to display' ) ; $ this -> _createSubHeader ( $ subHeader , $ width , 0 ) ; $ this -> tcpdf -> Bookmark ( $ subHeader , 0 , 0 , '' , 'B' , [ 0 , 0 , 0 ] ) ; return ; } if ( empty ( $ header ) || empty ( $ width ) ) { return ; } if ( empty ( $ align ) ) { $ align = [ ] ; } foreach ( $ data as $ subHeader => $ rows ) { if ( ! isAssoc ( $ rows ) ) { if ( $ this -> _getFlagUseNonBreakingCells ( ) ) { $ this -> tcpdf -> setAutoPageBreak ( false ) ; $ this -> tcpdf -> startTransaction ( ) ; } if ( ! empty ( $ prevHeader ) ) { $ this -> _createSubHeader ( $ prevHeader , $ width , $ prevLevel ) ; $ this -> tcpdf -> Bookmark ( strip_tags ( $ prevHeader ) , $ prevLevel , 0 , '' , 'B' , [ 0 , 64 , 128 ] ) ; } if ( ! empty ( $ subHeader ) ) { $ this -> _createSubHeader ( $ subHeader , $ width , $ level ) ; $ this -> tcpdf -> Bookmark ( strip_tags ( $ subHeader ) , $ level , 0 , '' , 'B' , [ 0 , 64 , 128 ] ) ; } $ this -> _createTableHeader ( $ header , $ width ) ; $ this -> _createTableRows ( $ rows , $ width , $ align , $ header , $ subHeader , $ level , $ prevHeader , $ prevLevel ) ; if ( ! empty ( $ prevHeader ) ) { $ prevHeader = '' ; } } else { $ subLevel = $ level + 1 ; $ this -> table ( $ rows , $ width , $ align , $ header , $ subLevel , $ subHeader , $ level ) ; } $ y = $ this -> tcpdf -> GetY ( ) ; $ y += ( 12 / ( $ level + 1 ) ) ; $ this -> tcpdf -> SetY ( $ y ) ; } }
Write a table

@param array $data Array of rows for table.
@param array $width Array of width for table cells.
@param array $align Array of align position for table cells.
@param array $header Array of header for table cells.
@param int $level Current level of subheader (start from 0).
@param string $prevHeader Text of prev subheader.
@param int $prevLevel Prev level of subheader (start from 0).
@return void
Write a table