This commit is contained in:
the-djmaze 2022-01-10 13:23:36 +01:00
parent 32ce016af2
commit 99d7e5f0f1

View file

@ -497,7 +497,7 @@ abstract class HtmlUtils
if (\count($aStyles)) if (\count($aStyles))
{ {
$sStyles .= $sStyles . '; ' . \implode('; ', $aStyles); $sStyles .= '; ' . \implode('; ', $aStyles);
} }
} }
@ -514,6 +514,11 @@ abstract class HtmlUtils
else if ('table' === $sTagNameLower && $oElement->hasAttribute('width')) else if ('table' === $sTagNameLower && $oElement->hasAttribute('width'))
{ {
$aAttrsForRemove[] = 'width'; $aAttrsForRemove[] = 'width';
$sWidth = $oElement->getAttribute('width');
if (\ctype_digit($sWidth)) {
$sWidth .= 'px';
}
$sStyles .= "; max-width:{$sWidth}";
} }
if ($oElement->hasAttributes() && isset($oElement->attributes) && $oElement->attributes) if ($oElement->hasAttributes() && isset($oElement->attributes) && $oElement->attributes)