From 4fe154bd6aaf55d299249d207bff1795710452ca Mon Sep 17 00:00:00 2001 From: Simon Wanner Date: Mon, 28 Mar 2022 14:35:10 +0200 Subject: [PATCH] LibWeb: Expand the last cell in a row to the right edge --- Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp index 056bfce227..036b89221a 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp @@ -44,6 +44,12 @@ void TableFormattingContext::run(Box const& box, LayoutMode) calculate_column_widths(row, column_widths); }); + float missing_width = box_state.content_width; + for (auto column_width : column_widths) + missing_width -= column_width; + if (missing_width > 0) + column_widths[column_widths.size() - 1] += missing_width; + float content_width = 0; float content_height = 0;