djlint / djLint

✨ HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang
https://djLint.com
GNU General Public License v3.0
686 stars 84 forks source link

[FEATURE]thead should include <th> or <td> but not a mixture of both #930

Open yourpropertyexpert opened 1 week ago

yourpropertyexpert commented 1 week ago

Feature Request

This, I think, requests a new rule. Apologies if I'm posting in the wrong place.

I've just spent a while tracking down a formatting issue whose root cause was that a thead section included a single td in a bunch of th... and that the two had different css settings.

I realise that lots of sites use td instead of th, so I'm NOT suggesting that djlint check for td in thead.

But what would be useful would be if it could scan to make sure that a thead ... /thead section didn't contain a mix of the two!

This happened to be in a Mustache template, but I suspect applies wherever html tables are being linted.