2 namespace wcf\system\html\output\node
;
3 use wcf\system\html\node\AbstractHtmlNodeProcessor
;
6 * Adds wrapper div for tables to allow content overflow with scrollbars.
8 * @author Alexander Ebert
9 * @copyright 2001-2018 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package WoltLabSuite\Core\System\Html\Output\Node
14 class HtmlOutputNodeTable
extends AbstractHtmlOutputNode
{
18 protected $tagName = 'table';
23 public function process(array $elements, AbstractHtmlNodeProcessor
$htmlNodeProcessor) {
24 if ($this->outputType
=== 'text/html' ||
$this->outputType
=== 'text/simplified-html') {
25 /** @var \DOMElement $element */
26 foreach ($elements as $element) {
27 // check if table is not contained within another table
29 while ($parent = $parent->parentNode
) {
30 if ($parent->nodeName
=== 'table') {
35 $div = $element->ownerDocument
->createElement('div');
36 $div->setAttribute('class', 'messageTableOverflow');
38 $element->parentNode
->insertBefore($div, $element);
39 $div->appendChild($element);