Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
According to XHTML1 Strict,
is not allowed (check http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd line 862)
Attached patch modifies theme_table to check if there are columns to render before adding a row to the output.
Comment | File | Size | Author |
---|---|---|---|
#3 | no_empty_rows_2.patch | 1.46 KB | pwolanin |
theme.inc_.no_empty_rows.patch | 934 bytes | traxer | |
Comments
Comment #1
traxer CreditAttribution: traxer commentedAccording to XHTML1 Strict, <tr></tr> is not allowed; a table row must contain at least one td- or th-tag.
Comment #2
traxer CreditAttribution: traxer commentedI just noticed that theme_table() might also create other kinds of empty elements. However, I did not see any pages that are affected by that.
Empty table rows can be found at admin/build/themes in Drupal 5.1
Comment #3
pwolanin CreditAttribution: pwolanin commentedpatch code looks simple and reasonable.
However, there are two minor problems:
patch should be made from the drupal root directory
the if statement should be sooner so that the odd/even class doesn't flip if the row is empty
new patch addresses these problems and should be RTBC.
Comment #4
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #5
(not verified) CreditAttribution: commented