Edge Rewrite
Jump to content

Template talk:Table row counter

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 1 month ago by RSStockdale in topic Incorrect count

WHERE style statement

[edit]

I'm wondering if we can implement a where-like clause. Lists of video games can have different parameters that are currently updated by hand, so is this feasible? Zero Serenity (talk - contributions) 19:37, 12 January 2018 (UTC)Reply

Agreed, I would like to see the ability to count rows where a column has a specific value or values. --RSnook (talk) 19:14, 30 January 2018 (UTC)Reply

Count failure

[edit]

I have a long table in a list article: List of secondary school sports team names and mascots derived from indigenous peoples#Prior usage. The counter (which I commment-out between tests) only returns "4". I would be happier if it just failed.--WriterArtistDC (talk) 01:27, 15 August 2021 (UTC)Reply

Works now, the problem was using the ! to shade the first column in the table. Then why not return zero?--WriterArtistDC (talk) 01:53, 15 August 2021 (UTC)Reply
The current implementation doesn't count any rows starting with a header cell, which is bad because the accessibility guidelines recommend data rows with headers. The right logic is to count rows that have one or more non-header cells, ignoring those consisting of only header cells. --Fernando Trebien (talk) 22:16, 9 December 2021 (UTC)Reply
Would it be possible to build in an option to include rows that start with header cells, with the possible exception of the row at the top of the table? Maybe there could be an if statement within or wrapped around "local headers". – Jonesey95 (talk) 23:56, 28 June 2023 (UTC)Reply

Incorrect count

[edit]

On the page "Nikon Z-mount", I was going to add a count of cameras in the section "Camera overview".

The correct count should be 15, but the template returns 13. The table has 2 header rows. Per the documentation, I had expected 1 row to not be counted, leaving a result of 16, which I could account for by using the ignore parameter to substract 1. I know that I can use an #expr to add 2 to the value returned, but I don;t know why it is incorrect, and am worried that a future change to the page or to this template might break it.

Any ideas? RSStockdale (talk) 13:35, 12 August 2026 (UTC)Reply