This content originally appeared on CSS-Tricks and was authored by Geoff Graham
Yes, yes. Functionally, they are different. But heck if I didn’t know about the wacky thresholds until Jens Oliver Meiert tooted a pair of quick polls.
According to the HTML Standard:
- If the current cell has a
colspan
attribute, then parse that attribute’s value, and let colspan be the result.
If parsing that value failed, or returned zero, or if the attribute is absent, then let colspan be 1, instead.
If colspan is greater than 1000, let it be 1000 instead.- If the current cell has a
rowspan
attribute, then parse that attribute’s value, and let rowspan be the result.
If parsing that value failed or if the attribute is absent, then let rowspan be 1, instead.
If rowspan is greater than 65534, let it be 65534 instead.
I saw the answers in advance and know I’d have flubbed rowspan
. Apparently, 1000
table columns are plenty of columns to span at once, while 65534
is the magic number for clamping how many rows we can span at a time. Why is the sweet spot for rowspan
6,4543 spans greater than colspan
? There are usually good reasons for these things.
What that reason is, darned if I know, but now I have a little nugget for cocktail chatter in my back pocket.
How are the `colspan` and `rowspan` attributes different? originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.
This content originally appeared on CSS-Tricks and was authored by Geoff Graham
Geoff Graham | Sciencx (2024-08-15T13:10:58+00:00) How are the `colspan` and `rowspan` attributes different?. Retrieved from https://www.scien.cx/2024/08/15/how-are-the-colspan-and-rowspan-attributes-different/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.