Template talk:Aligned table
colwidth, colNwidth? (rowstyle?)Great template. Since there's already colNalign and colNnowrap, maybe colwidth and colNwidth are worthwhile? Sardanaphalus (talk) 10:11, 1 June 2014 (UTC)
Non-Lua version... Just curiousI've seen Script error on non-Lua versions of the template. Could someone make a non-lua version of this? The "#invoke:aligned table|table" has created script errors. Aeverine Frathleen Nieves (talk) 15:12, 15 September 2014 (UTC)
colstyle, colspan, etcIs it possible to implement a colstyle for this template that applies to all columns but is overriden (but not replaced) by individual columns' colNstyles – i.e. for each column, the equivalent, I think, of Also – or, if the above is awkward or not possible, perhaps as an alternative – the ability to declare e.g. A colspan option, like that used in tables, would also be welcome, if possible/practicable. Sardanaphalus (talk) 17:52, 15 September 2014 (UTC) Empty-parameter handlingThis code... {{Aligned table |style=margin-left:1.4em;border:1px solid #aaa; |colstyle=padding:0.1em 0.4em; | A | B |{{{1|}}} |{{{2|}}} |{{{3|}}} |{{{4|}}} |{{{5|}}} |{{{6|}}} |{{{7|}}} |{{{8|}}} |{{{9|}}} |{{{10|}}} | M | N |{{{11|}}} |{{{12|}}} |{{{13|}}} |{{{14|}}} |{{{15|}}} |{{{16|}}} |{{{17|}}} |{{{18|}}} |{{{19|}}} |{{{20|}}} | Y | Z }}
i.e. the "empty" cells add whitespace to the table. Is there a way (that doesn't require e.g. many conditionals and/or "display:none;"s, etc) to prevent this, please..? Sardanaphalus (talk) 18:15, 21 November 2014 (UTC)
I apologise if my enquiry read as if a demand. Empty parameters filling otherwise empty cells seem a distinct possibility with this template, so I thought it would be of interest regardless of specific examples.
A way to reduce redundancy..?Hello again. Is there a way to avoid redundancy when defining the same (or very similar) kind of Aligned table more than once on a page, or even across pages – in other words, to be able to use something like... {{Aligned table [something brief (a template, class?)] | ... | (etc) }} ...... {{Aligned table [the something-brief] | ... | (etc) }} ...... ...rather than (for example)... {{Aligned table |class=nowrap |style=line-height:1.4em;overflow:auto; |col1width=[NNN]em |style1.1=padding-left:0.6em;padding-bottom:0.4em;border-bottom:1px solid #aaa;| '''[Header1]''' |style1.2=padding-left:1.6em;padding-bottom:0.4em;border-bottom:1px solid #aaa;| '''[Header2]''' |row2style=padding-top:0.6em; | ... | (etc) }} ...... {{Aligned table |class=nowrap |style=line-height:1.4em;overflow:auto; |col1width=[NNN]em |style1.1=padding-left:0.6em;padding-bottom:0.4em;border-bottom:1px solid #aaa;| '''[Header1]''' |style1.2=padding-left:1.6em;padding-bottom:0.4em;border-bottom:1px solid #aaa;| '''[Header2]''' |row2style=padding-top:0.6em; | ... | (etc) }} (Is it to define the configuration as a class somehow/somewhere..?) Sardanaphalus (talk) 06:17, 10 January 2015 (UTC) Needs |
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
The naked "rowstyle" parameter does not appear to be implemented in module:aligned table despite a row style being applied, and template:aligned table documenting such a parameter. Ideally, the unconditional row style "vertical-align:top;" could be made a proper default, or removed entirely. 87.254.79.130 (talk) 00:56, 10 June 2016 (UTC)
- Good catch, and thanks for updating the documentation page about the default.
|rowstyle=
now works with Special:Diff/724577491. I deem the spec (doc) correct and the code was just missing rowstyle customization. Testcase for|rowstyle=
is at testcases. — Andy W. (talk · ctb) 04:34, 10 June 2016 (UTC)
Whitespace stripping
@Frietjes: As Help:Template#Parameters says, whitespace is not stripped from the beginnings and ends of unnamed parameters. This apparently has a strange effect reported at Wikipedia:Help desk#Indenting issues in IPv4. Below is a simplified example.
; Bold text :This line and the following table are indented.{{aligned table| cols=2 | Cell1 | Cell2 }}
This line is not indented. All is well.
; Bold text :This line and the following table are indented.{{aligned table| cols=2 | Cell1 | Cell2 }}
This line is indented, at least for me in Firefox, because the last Cell2 is followed by a newline. Naming the parameter with 2=Cell2
will remove the indentation. PrimeHunter (talk) 02:22, 22 August 2016 (UTC)
- PrimeHunter, this template is just building the html table with very limited processing, and basically not processing of the actual cell contents. you can see the same thing if you were to use an HTML table directly:
; Bold text :This line and the following table are indented.<table><tr> <td>Cell1</td><td>Cell2 </td></tr></table>
This line is probably indented for you as well. so, it's not so much an issue with this template as it is an issue with how html tables and dl/dt lists are processed by the server and the browser. Frietjes (talk) 13:45, 22 August 2016 (UTC)
- PrimeHunter, I added functionality to strip trailing whitespace, so this version of IPv4 now renders as expected, and your example above is fixed. as far as I can tell, stripping trailing whitespace is safe for this module/template. we just can't strip leading whitespace since that could mangle lists. Frietjes (talk) 12:51, 24 August 2016 (UTC)
- Frietjes, PrimeHunter, or anyone else reading here, the above wikitext featuring indenting with a colon and a
<table>
tag on the same line, coding for a table appearing just above "This line is probably indented for you as well", generates a Multiline table in list lint error, so please don't do that. —Anomalocaris (talk) 05:55, 8 May 2019 (UTC)
- Frietjes, PrimeHunter, or anyone else reading here, the above wikitext featuring indenting with a colon and a
rightleft
This edit request to Module:Aligned table has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Would it be possible to add the following code to counterbalance leftright and to easily get the opposite effect when so desired?
- i.e. |col1align=right and |col2align=left
if isnotempty(args['rightleft']) then
colstyle[1] = 'text-align:right;'
colstyle[2] = 'text-align:left;'
end
Jay D. Easy (talk) 01:38, 19 March 2019 (UTC)
- Done -- /Alex/21 07:13, 22 March 2019 (UTC)
Portal di Ensiklopedia Dunia