diff --git a/Libraries/LibWeb/DOM/HTMLTableElement.cpp b/Libraries/LibWeb/DOM/HTMLTableElement.cpp
index 0a00448d709..254b9c50a1e 100644
--- a/Libraries/LibWeb/DOM/HTMLTableElement.cpp
+++ b/Libraries/LibWeb/DOM/HTMLTableElement.cpp
@@ -25,6 +25,7 @@
*/
#include
+#include
namespace Web {
@@ -37,4 +38,13 @@ HTMLTableElement::~HTMLTableElement()
{
}
+void HTMLTableElement::apply_presentational_hints(StyleProperties& style) const
+{
+ for_each_attribute([&](auto& name, auto& value) {
+ if (name == HTML::AttributeNames::width) {
+ style.set_property(CSS::PropertyID::Width, parse_css_value(value));
+ }
+ });
+}
+
}
diff --git a/Libraries/LibWeb/DOM/HTMLTableElement.h b/Libraries/LibWeb/DOM/HTMLTableElement.h
index b68a08d56e1..a6b8689a857 100644
--- a/Libraries/LibWeb/DOM/HTMLTableElement.h
+++ b/Libraries/LibWeb/DOM/HTMLTableElement.h
@@ -30,10 +30,13 @@
namespace Web {
-class HTMLTableElement : public HTMLElement {
+class HTMLTableElement final : public HTMLElement {
public:
HTMLTableElement(Document&, const FlyString& tag_name);
virtual ~HTMLTableElement() override;
+
+private:
+ virtual void apply_presentational_hints(StyleProperties&) const override;
};
template<>