Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html.elements.tbody - "char" and "charoff" attributes - were/are they really ever supported? #15657

Open
myfonj opened this issue Apr 4, 2022 · 4 comments
Labels
data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML

Comments

@myfonj
Copy link
Contributor

myfonj commented Apr 4, 2022

What information was incorrect, unhelpful, or incomplete?

Compat tables suggest that construct like <tbody align="char" char="." charoff="3"> (or same attributes on col, tfoot, thead, td, tr, td) makes text cells aligned at . (dot) character in IE and Edge since "v12". Thrilling!

What did you expect to see?

Sad boring column indicating it was never been supported in any major browser.

Did you test this? If so, how?

I remember XHTML wars and HTML4.1 and this attribute is my personal favourite of nice but unreachable things in specs; I think I would have noticed if it was rally supported in any major browser at some point in history. (Although, I don't have pre-chromium edge at hand ATM, so maybe I missed it in the end. I'm pretty sure IE up to 11 did not support it, though.)

MDN page report details
@queengooborg queengooborg added the data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML label Apr 4, 2022
@strarsis
Copy link
Contributor

strarsis commented Feb 28, 2023

The functionality of char was moved into the CSS text-align property and it is indeed listed there.
There is no compat data currently on MDN however or whether a vendor prefix is required.
caniuse does not list compat info either.

This feature is actually quite useful, as aligning table cell text (usually by a decimal point) is not always solvable by using something like text-align: right (or the direction where the least significant digit goes).

text-align: <string> and text-align: <string> [alignment] do not work in Chrome, here is a simple example that uses it and does not appear to work in latest Chrome (Windows): https://codepen.io/strarsis/pen/WNgROEm

Notes and deprecation of the original attributes on MDN:

Also found a page with workarounds here:
https://krijnhoetmer.nl/stuff/javascript/table-align-char/

@myfonj
Copy link
Contributor Author

myfonj commented Feb 28, 2023

NVM, it is in the draft for CSS Text Module Level 4

https://drafts.csswg.org/css-text-4/#text-align-property

(since at least 2015). I was just not paying adequate attention.


The functionality of char was moved into the CSS text-align property […]

This is another interesting topic. It is indeed mentioned at the MDN page (https://developer.mozilla.org/en-US/docs/Web/CSS/text-align#values) as

<string> Experimental
When applied to a table cell, specifies the alignment character around which the cell's contents will align.

yet only valid values in the linked specification

https://w3c.github.io/csswg-drafts/css-text/#text-align-property
https://www.w3.org/TR/css-text-3/#text-align-property

is a fixed set of keywords:

Name: text-align
Value: start | end | left | right | center | justify | match-parent | justify-all

Frankly don't remember any historical CSS specification that included

td { text-align: '.'; }

as a valid option, but now I see it in "W3C Working Draft 13 November 2012"

https://www.w3.org/TR/2012/WD-css3-text-20121113/#text-align

[ [ start | end | left | right | center ] || ] | justify | match-parent | start end

with a caveat in the introduction ("Status"), that reads

The following features are at risk and may be cut from the spec during its CR period if there are no (correct) implementations:
[...] the ‘start end’ and ‘<string>’ values of ‘text-align’ [...]

I guess the bad scenario happened and no (major) browser managed to implement it so it had been dropped, or it simply disappeared when WHATWG got involved. Peeked into mail archives and it does not seem to be discussed back then, nor was it discussed in csswg-drafts.

@caugner
Copy link
Contributor

caugner commented Jan 17, 2025

Related: #21828

@myfonj
Copy link
Contributor Author

myfonj commented Jan 17, 2025

Seriously, seeing such misleading (?) information from the BCD at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody (and all other table elements) is really unfortunate :(

Image

Or is that information really correct and all browsers except Firefox support that all the time? Really?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML
Projects
None yet
Development

No branches or pull requests

4 participants