Last modified: 2013-01-31 14:07:06 UTC
The wikitext {| class="wikitable" |- |- |- |- <span>Text outside table</span> |- |- |- |} is rendered as <p><span>Text outside table</span></p> <table class="wikitable"></table> which allows content outside a table to be generated from within a table. This is currently (ab-?)used by infobox templates at dewiki to generate several sorts of "maintenance" stuff (basically wikilinks inside a span with display:none) outside the table, based on conditionals that are checked inside the table, without generating an empty table row. It does, however, generate an additional paragraph before the table that cannot be hidden with display:none. It's rendered like an empty paragraph (because all its contents is hidden with display:none), but can still impact page rendering because it has margins. Not to say that it is unsemantic. Trying to get rid of the additional paragraph by using a block element as in {| class="wikitable" |- |- |- |- <div>Text outside table</div> |- |- |- |} however gives <div>Text outside table</div> <p><br></p> <p><br></p> <p><br></p> <table class="wikitable"></table> Why does each empty row after the div now suddenly generate a paragraph with just a line break in it?
Retesting with 1.21wmf8: (In reply to comment #0) > rendered as > > <p><span>Text outside table</span></p> > <table class="wikitable"></table> Nowadays I get pretty much the same: <div lang="en" dir="ltr" class="mw-content-ltr"><p><span>Text outside table</span></p> <table class="wikitable"></table> Second example: > <div>Text outside table</div> > <p><br></p> > <p><br></p> > <p><br></p> > <table class="wikitable"></table> Same result here: <div>Text outside table</div> <p><br /></p> <p><br /></p> <p><br /></p> <table class="wikitable"></table>