01546: CSS "valign" attribute is considered obsolete

Summary: CSS "valign" attribute is considered obsolete
Created: 2026-03-24 06:17
Status: ToDo
Category: Feature
From: gnuzoo
Assigned:
Priority: 51
Version: all
OS: all

Description: The valign attribute is considered obsolete in HTML5 and should be replaced with CSS for vertical alignment. This change is part of the broader effort to separate content structure from presentation, making CSS the preferred method for styling web pages. The valign attribute was used to control the vertical alignment of content within table cells, but its use is now discouraged in favor of CSS properties like vertical-align. This approach not only improves code quality but also ensures that browsers continue to support the attributes without breaking layouts.

gnuzoo

There is the variable $EnableTableAutoValignTop, set to 0 to disable automatic valign=top for complex table cells. You can then use CSS classes or styles in your tables. Petko

Just a little more discussion --
PmWiki CSS should replace valign with vertial-align.
Replace $EnableTableAutoValignTop with $EnableTableAutoVertcalAlignTop
and only affect places where 'valign' was used. Browsers might stop
supporting valign. Doing so now is better than better than being forced
to do it all immediately later. If someone sets $EnableTableAutoValignTop
provide and error message telling them to change it to the new variable.
--gnuzoo

I am considering automatically converting align and valign attributes to CSS classes. What about other deprecated attributes like rules, bgcolor, width, height, cellpadding, cellspacing, border? These would not be easily translated to CSS classes because they contain individual values -- we cannot add classes for every possible cellspacing or bgcolor value.

We could possibly add a few standard classes and rewrite the documentation to reflect these, removing the parts about attributes, without removing the attributes themselves. So new wikis would use table classes, and old tables with attributes would still work. Petko

> What about other deprecated attributes

IMHO, everything deprecated should be at least listed and hopefully scheduled to be adjusted/fixed/documented/deleted whatever. My experience is that they will come back to haunt you later if you do not address them sooner than later. --gnuzoo