From b41bbc3e4e4c91ece51137c5f257449df24a1f55 Mon Sep 17 00:00:00 2001 From: makerprism-bot <261184658+makerprism-bot@users.noreply.github.com> Date: Sun, 19 Apr 2026 21:26:13 +0000 Subject: [PATCH] fix: Add width=100% to Footer outer table for Outlook compatibility Outlook for Windows requires the HTML width attribute (not CSS) on tables to prevent them from collapsing to content width. Without width="100%", Footer tables shrink to fit their text content and align unpredictably instead of spanning the full container width. This matches the pattern already used by Section, Callout, and Spacer, all of which emit width="100%" on their outer tables for the same reason. caniemail reference: https://www.caniemail.com/features/html-table/ Changes: - lib/footer.ml: Add "width", "100%" to table attributes - test/structure_tests.ml: Assert width=100% on both Footer paths - test/golden/footer.html: Update golden snapshot Co-Authored-By: Claude Sonnet 4.6 --- lib/footer.ml | 1 + test/golden/footer.html | 4 ++-- test/structure_tests.ml | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/footer.ml b/lib/footer.ml index ebb1967..2e46f6c 100644 --- a/lib/footer.ml +++ b/lib/footer.ml @@ -40,6 +40,7 @@ let to_element footer = "cellpadding", "0"; "cellspacing", "0"; "role", "presentation"; + "width", "100%"; ] ~children:[Element.Private.make @@ Element.Private.builder ~tag:"tr" diff --git a/test/golden/footer.html b/test/golden/footer.html index ae026af..ca57e0e 100644 --- a/test/golden/footer.html +++ b/test/golden/footer.html @@ -1,8 +1,8 @@ -
© 2024 Company Name
+
© 2024 Company Name
-
© 2024 Company Name. All rights reserved.
+
© 2024 Company Name. All rights reserved.
diff --git a/test/structure_tests.ml b/test/structure_tests.ml index 26309f0..15f9600 100644 --- a/test/structure_tests.ml +++ b/test/structure_tests.ml @@ -381,6 +381,7 @@ let test_footer_string_shortcut () = let html = Element.to_html (Footer.to_element footer) in assert_test "Footer (string): table wrapper present" (html_contains html "