can anyone explain me this weird browser behavior:
It seems to be, that the browser gets the content of $openingHours to late. If I replace this var with a random text – everything is well structured. Has anyone an idea or some links, which would explain that?
A paragraph cannot contain any other block-level elements (for example a table).
The HTML you are generating is not valid. It is possible that the browser is not able to interpret the table inside a paragraph and therefore makes its own conclusions.