From 2a3ae4ebdba6d082f598483ef742309ddd4009ab Mon Sep 17 00:00:00 2001 From: Miguel Martinez Date: Sun, 2 Jul 2023 10:54:42 +0200 Subject: [PATCH] Incorrect column width calculation in ezTable #179 --- src/Cezpdf.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cezpdf.php b/src/Cezpdf.php index 44a4e41..d5654ff 100644 --- a/src/Cezpdf.php +++ b/src/Cezpdf.php @@ -1293,10 +1293,10 @@ public function ezTable(&$data, $cols = '', $title = '', $options = '') $widest = 0; foreach ($cols0 as $colName => $w) { if ($w > $widest) { - $aWidest = [$colName]; + array_unshift($aWidest, $colName); $nWidest = $widest; $widest = $w; - } elseif ($w == $widest) { + } else { $aWidest[] = $colName; } }