Template:Autocol

-NOTES: -- -- NOTE A1: Columns are split if item# mod (n/ncols +0.499 round 0) = 0, --     which then puts " " to start the next column. --     In wikitables, the end td-tag is assumed upon next. -- -- NOTE G2: The column gap spacing, set by colgap=5, would also append --     beyond the final column, so all colgap spacing is omitted at --      items {41} to {64}, and halved as colgap/2 for {21} to {40}. --     So, items at {21} will be less-spaced near the later items, but --     any rare inbalance can be corrected by putting &nbsp's at the --     end of data items among {21} and later. The concept is to reduce --     the spacing after the end-column, without running a complex --     formula to skip spacing at the actual item numbers. However, the --     calculation would be (ncols - item# / (n/ncols +.49 round 0) ) --     or similar, to be zero for item numbers in the final column. --     Instead, halving the spacing at {21}, and omitting all at {41}, --     runs faster & seems less confusing for modifying the template. --     If problems arise, that calculation could be added for colgap. -- -- NOTE P3: Expansion depth of the template is only 5 levels deep, to --      allow quick use in infoboxes or complex templates, if needed. --     The performance concerns require the use of n=count, to avoid --     using a subtemplate to count items and then run with parameter n. --      If there were a parser function {#set:n|32}, then items could be --      counted at the start of the template, setting counter n, and then --     the remainder would use that value of n. The lack of setting a --      parameter value is one of the most crippling aspects of template --     operation. Fortunately, there are many tactics to set n, --     while allowing for blank items to auto-adjust to added items, --     and so the value of n is not much of an actual problem. -- -- NOTE N4: Handling of newlines uses bizarre quirks in if-structures --     to avoid extra newlines for wrap=y, or num=y or the asterisk --     bullets. To recognise "* aa" then each item parameter must --     be in column 1 of a line in the template, even though article --     text could have a leading if-structure before a bullet, --     in the template the if-structure would disable the asterisk- --     bullet and show only an asterisk "*" not a bullet. Also, --     an empty else-clause "|}}" in the #if-num logic stops an extra --     newline being displayed at the top of each column (after the --      cell is triggered " ". The markup is precariously --      set to avoid wiki-warped freakouts for each combination of --      options. Hence, any changes to the if-structures might totally --      spazify column format for a particular set of options. Note that --      other markup languages rarely have such peculiar, warped antics --      where an if-structure which works inside article text would work --      differently when inside the middle of a template. In fact, many --      people might have concluded this template would be impossible --      to write because of quirks in the newlines of column items. -- --      It has taken years of writing other templates to realize just --      how bizarre the markup runs. For example: #hash-name --      will show a newline number when lowercasing: "1. hash-name". --

-HISTORY: -09Sep2012 Created multi-column, any browser, vs. {Div_col} CSS3 limits. -11Sep2012 Put HISTORY comments to log major changes (not typos). -11Sep2012 Put NOTES comments to explain template operation & limits. -11Sep2012 Redid colgap as only {padleft:|m| } as 1,200 per sec. -12Sep2012 Removed colgap right-side padding &nbsp's at items 41-64. -12Sep2012 Halved colgap padding by {padleft} &nbsp's at items 21-40. -12Sep2012 Moved doc-text to /doc subpage and expanded. -16Sep2012 Put option "num=y" to number the items in all columns. -17Sep2012 Split all if-wrap "}}" & "{{" to have newlines. -17Sep2012 Put empty else-clauses to stop extra newline at column tops. -17Sep2012 Put NOTE N4 to explain issues in precarious use of newlines. -11Nov2012 Fixed to check limit of "n=" as 64 (was "120"). -11Nov2012 Fixed to put empty span-tag " 64. -11Nov2012 Fixed logic to actually warn of items beyond n & n+1. --> {{documentation|Template:Autocol/doc}}