Template:Nopt/doc

nopt is for instances when a table must be continued across pages. It works by inserting a HTML comment followed by a newline such that the actual content (the table markup) is forced to the next line.

Usage
Put…

…at the start of the footer on the first page, and at the start of the page content on the second page (for a table spanning three pages or more, you would have it in both places). In the footer of the first page it prevents the  from getting smushed into the contents of the last table cell in the Page: namespace. At the start of the content of the second page it does the same for,  , or   (or any other table wikimarkup that must be on its own line) when the pages are transcluded.

Technical details
MediaWiki's table syntax and ProofreadPage's transclusion behaviour does not always interact well: most table markup must be at the very beginning of a line to work, and ProofreadPage plays various tricks (relative to standard MediaWiki) specifically to make the joints between separate areas seamless that in some situations interfere with the table syntax.

There are two main places where this happens: between the content and footer of a single page in the Page: namespace, and between the end of one page and the beginning of the next when they are transcluded together into mainspace.

Between content and footer
Within a single page in the Page: namespace there are three distinct parts: the header, the main content, and the footer. The header and footer are wrapped in  tags so they will not be included when the page is transcluded to mainspace. Under the hood, these three parts are actually stored as a single wikipage, but ProofreadPage parses out the two special sections and presents them in separate text field when editing for convenience. But this also means that when you are looking at a saved page in the Page: namespace, MediaWiki has to join together these three parts to show them to you. When it does so, it will remove any trailing whitespace from the content area, and any leading whitespace in the footer area, leading to whatever you put at the beginning of the latter getting smushed onto the end of the former. This works fine for most things.

However, when you're dealing with a table that's split over multiple pages, you need to use wikimarkup like this:

When these are joined together for display, the resulting code becomes:

Since this table markup has to be at the beginning of a line to work, what gets displayed is something like this (rendering will vary depending on circumstance):

To work around this problem you can use, like so:

inserts a HTML comment and a newline, that are invisible in the rendered output, but when the content and footer parts are joined together you end up with:

Because of the HTML comment (invisible like whitespace, but not removed by MediaWiki) the table markup is now on its own line and works as usual. The result would be:

Between subsequent pages
When a table continues across multiple page you must open the table in the content part of the first page; close the table  in the footer of the first page, so it renders correctly in the Page: namespace; reopen the table  in the header of the following page; repeat for each intermediate page, if any; and finally close it   in the content part of the last page. When the pages are trancluded together into mainspace the intermediate opening and closing markup is left out, and a single continuous table is rendered.

The transclusion in ProofreadPage is set up primarily for non-table content (running prose), so it will strip out extraneous leading and trailing whitespace and replace them with a single space character. This is so that pages containing "One nation" and "under God!" will end up as "One nation under God!" rather than "One nationunder God!". For tables, however, this creates a problem:


 * First page


 * Second page

When these are transcluded together for display in mainspace, the resulting code becomes:

Since this table markup has to be at the beginning of a line to work, what gets displayed is something like this (rendering will vary depending on circumstance):

To work around this problem you can use, like so:


 * First page


 * Second page

inserts a HTML comment and a newline, that are invisible in the rendered output, but when the two pages are joined together you end up with:

Because of the HTML comment (invisible like whitespace, but not removed by MediaWiki) the table markup is now on its own line and works as usual. The result would be: