If we attempt code like this:
<td [colspan]="1 + 1">Column</td>
or this:
<td colspan="{{1 + 1}}">Column</td>
We soon find out that "colspan
is not a known native attribute."
From the A2 docs we learn that:
the element does not have a colspan property. It has the "colspan" attribute, but interpolation and property binding can set only properties, not attributes.
We must instead do this:
<td [attr.colspan]="1 + 1">Column</td>
Which is fair enough.
Question:
My question is, why is colspan
not an attribute of the DOM, and if it is missing, how can the browser possibly render tables, since the browser renders the DOM and not the HTML?
Also, if I open my Chrome inspector, and go to the properties tab, why can I see colspan as a property of the Element?
Why does the DOM exhibit this inconsistency?