In itwiki we have noticed Tidy adds an unwanted closing table tag (</table>) in some situations. I have summarized the problem in this page:
The page transcludes just another page https://it.wikipedia.org/wiki/Utente:Rotpunkt/TableRow, acting as a template.
As you can see, the second section "Example not working" doesn't work. Tidy indeed adds </table> just after the first row, and so the table is corrupted.
If you disable Tidy, the closing table tag </table> isn't added and the page works correctly, as you can see at: