ChrisB: Tabelle lässt sich zwar drehen, aber nicht zurückdrehen

Beitrag lesen

Hi,

tr ist kein Kind von table sondern von tbody [...]
Diese Aussage ist in ihrer Absolutheit leider falsch. In HTML gilt das zweifelsfrei und ohne Ausnahme, in XHTML kann tr jedoch Kind von table sein, dort gibt es keine optionale Notation von Elementen, entweder sie sind da oder nicht.

Kommt auf die Betrachtungsweise an - aus HTML-DOM-Sicht, und damit der heute ueblicher Implementierungen in HTML-UAs stimmt Vinzenz' Aussage, denn http://www.w3.org/TR/2002/REC-xhtml1-20020801/#C_11 besagt:

"1. User agents that access XHTML documents served as Internet media type text/html via the DOM can use the HTML DOM [...]"

Sofern der UA das macht, stimmt das gesagte also aus DOM-Sicht m.E.

Wenn wirklich XML-DOM genutzt wird, sieht es anders aus:

"2. [...] Also, some XHTML elements may or may not appear in the object tree because they are optional in the content model (e.g. the tbody element within table). This occurs because in HTML 4 some elements were permitted to be minimized such that their start and end tags are both omitted (an SGML feature). This is not possible in XML. Rather than require document authors to insert extraneous elements, XHTML has made the elements optional. User agents need to adapt to this accordingly."

Ich habe allerdings noch nicht ausprobiert, wie real existierende, X(HT)ML verarbeitende UAs das in der Praxis umsetzen.

MfG ChrisB