diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9004616..21210f5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [UNRELEASE]
+### Fixed
+
+- Fixed table formatting and border in PDF
+
## [4.0.2] - 2025-09-30
- Fix missing images in exported Knowledge Base PDFs
diff --git a/inc/simplepdf.class.php b/inc/simplepdf.class.php
index 5c06d71..556437b 100644
--- a/inc/simplepdf.class.php
+++ b/inc/simplepdf.class.php
@@ -346,10 +346,30 @@ public function displayText($name, $content = '', $minline = 3, $maxline = 100)
$this->setColumnsSize(100);
$text = $name . ' ' . $content;
$content = Glpi\RichText\RichText::getEnhancedHtml($text);
- if (!preg_match("/
/", $content) && !preg_match('/
/', $content)) { - $content = nl2br($content); + + // Split content by tables, keeping tables in the result + $segments = preg_split('/(