Template talk:Row hover highlight


 * Note: Template:Mw-datatable/styles.css was moved (without redirect) to Template:Row hover highlight/styles.css on June 18, 2022.

mw-datatable class had white background for data cells
. Please have a look at: . I started that task back when mw-datatable was still working. I wrote:


 * "class=mw-datatable (usually combined with class=wikitable) is used more and more. It produces a white background color that is preferred by many for statistic tables. Due to the better contrast and readability for many people. Versus the light gray background color of class=wikitable used alone. Plus class=mw-datatable will highlight the row that the cursor hovers over. Making it easier to scan across that row, especially if it is a long row."

Template:Import-blanktable/styles.css duplicated what mw-datatable did when it was working.

See examples: Help:Table

Can you add the white background too? --Timeshifter (talk) 13:35, 8 June 2022 (UTC)
 * . Please try this out. It's what people expect from class=mw-datatable.
 * Comparing the CSS:
 * Template:Row hover highlight/styles.css

.hover-highlight tr:hover td, .mw-datatable tr:hover td {background-color: #eaf3ff}
 * Template:Import-blanktable/styles.css

.tpl-blanktable { background: #fff; } .tpl-blanktable tr:hover { background: #eaf3ff; }

So the combination would be?: .hover-highlight tr:hover td, .mw-datatable {background: #fff;} .mw-datatable tr:hover td {background-color: #eaf3ff}
 * --Timeshifter (talk) 04:42, 13 June 2022 (UTC)


 * Timeshifter, I followed Jdlrobson's suggestion at T287997 upon Izno's recommendation that it should solely add the hover over effect rather than make any other modifications to the relevant CSS. If you want to see a specific css, you know you can add it to your common.css or skin.css, right? For more than that, you need consensus (which you clearly don't have). — Guarapiranga ☎ 00:39, 19 June 2022 (UTC)
 * Jdlrobson gave some CSS that would work for hover. He did not say he was against the white background. And he did not follow Izno's comment. Izno's comment was later in the task thread. And Izno was talking about what should be incorporated into global or common CSS, not a template.
 * Krinkle agreed with me, and quoted me, and created a template that incorporated both the hover and the white background. See: Krinkle comment
 * Several others in T287997 supported keeping mw-datatable in global CSS as is, and that was with both hover and white background. For example, see Eric0892 comment.
 * In global CSS it was liked and used many times in other language wikis too. XanonymusX comment. And Base comment.
 * I see a simpler solution,.
 * mw-datatable should redirect instead to Krinkle's template, Template:Import-blanktable. See redirect page:
 * https://en.wikipedia.org/w/index.php?title=Template:Mw-datatable&redirect=no
 * As discussed in T287997 Krinkle worked on mw-datatable in 2011. He created the template to duplicate it after mw-datatable no longer worked correctly in global CSS.
 * Also, this way we avoid duplication with your template here that currently only does hover highlighting.
 * Of course some additional mw-datatable CSS would have to be added to Template:Import-blanktable to allow it to work on all the many old pages using class=mw-datatable that now have added above the table wikitext by you and others.
 * --Timeshifter (talk) 04:13, 19 June 2022 (UTC)

. What is the normal naming system for CSS template sandboxes? I don't have a lot of time, but I can try to test this.

It's been a long time since I did CSS sandbox tests for templates. If ever. I don't remember. And I probably used incorrect naming.

Is there a forum just for template help? --Timeshifter (talk) 02:24, 16 June 2022 (UTC)
 * WP:RT — Guarapiranga ☎ 00:40, 19 June 2022 (UTC)

Merge discussion
See: Templates for discussion/Log/2022 June 19. --Timeshifter (talk) 22:54, 19 June 2022 (UTC)

White background added per merge discussion close
Per the merge discussion closing here: "The result of the discussion was merge to Template:Row hover highlight."
 * Templates for discussion/Log/2022 July 4

 .mw-datatable {background: #fff;} 

Added here: Template:Row hover highlight/styles.css

See diff. You can see it right away by saving the page with the table. Even a save without making any changes. This will not show up in the edit history.

I am talking about tables that are using mw-datatable just above the table, and class=mw-datatable within the table.

I did some more tests here: User:Timeshifter/Sandbox177. I don't see any problems with background colors set for rows, or individual cells. See sections titled: "With Template:mw-datatable and class=mw-datatable"

I am going to wait before adding the CSS for this to have a white background:

Do I just add this?

 .hover-highlight {background: #fff;}  Like this? .hover-highlight tr:hover td, .hover-highlight {background: #fff;} .mw-datatable tr:hover td {background-color: #eaf3ff} .mw-datatable {background: #fff;}

Krinkle's template seems to be doing this more simply (without td):
 * Template:Import-blanktable/styles.css

I compressed the format: .tpl-blanktable {background: #fff;} .tpl-blanktable tr:hover {background: #eaf3ff;} --Timeshifter (talk) 20:13, 7 October 2022 (UTC)

Merging
Notified: Template talk:Import-blanktable, Templates for discussion/Holding cell. House Blaster talk 23:50, 23 December 2023 (UTC)

I was looking at the pending merger. Currently, we have three classes that add a highlight (#eaf3ff) upon hover, but they all do it slightly differently: The easiest way to merge the templates would be to support all three classes at Template:Row hover highlight/styles.css. However, I suspect that this merge has not been completed in the past 17 months because that is not the solution anyone wants. I propose we deprecate  in favor of. The header is already distinguished from the rest of the table, so it does not need to be highlighted. House Blaster talk 23:43, 23 December 2023 (UTC)
 * . The header row highlighting is for tables that don't use class=wikitable. Those headers are the same color as the data cells. So row highlighting of the headers would be useful in that case. The CSS for it could be merged into the CSS for Row hover highlight.
 * I believe there are bots that can substitute Row hover highlight for import-blanktable. They could also substitute mw-datatable for tpl-blanktable. The bots would have to make around 400 substitutions.--Timeshifter (talk) 00:44, 24 December 2023 (UTC)
 * For clarity, you are proposing we deprecate, but add the heading functionality to the other two classes? If so, I would support that proposed solution. House Blaster talk 01:51, 24 December 2023 (UTC)
 * Yes, that is what I propose. But the tpl-blanktable class would have to stay functional until all the class substitutions were done. We can say that it is deprecated now, so that people stop adding it to more tables.
 * We could just add the tpl-blanktable class to Row hover highlight CSS now.
 * Then we could redirect import-blanktable to Row hover highlight.
 * Then we could merge the header functionality to the other 2 classes. Then we could use the bots to substitute the mw-datatable class for tpl-blanktable. --Timeshifter (talk) 02:16, 24 December 2023 (UTC)
 * I don't think it would be worthwhile to include  in row hover highlight. Right now, it is easy to tell which pages use   (and thus which pages need to be fixed): it is just the pages which transclude import-blanktable. It would also make it easier to use , which is counterproductive.I have gone ahead and added the header functionality. House Blaster talk 02:33, 24 December 2023 (UTC)
 * As long as the bots do both substitutions in the same day, then there will not be any serious disruption. But if the 2 substitutions are separated by days, weeks, months, then there is no row highlighting on the ~400 pages during that time.
 * I would rather nuke import-blanktable now by redirecting it. Of course that would mean having to add the tpl-blanktable class now too. But we don't have to tell anybody about it. While waiting for its substitution to occur. --Timeshifter (talk) 02:45, 24 December 2023 (UTC)
 * I think it would be easier if we changed both the template and the name of the class in the same edit. House Blaster talk 03:04, 24 December 2023 (UTC)

If we redirected the import-blanktable page, then its info would no longer exist. People wouldn't know about it or its class. So less use. I don't know what you mean about changing the class name. Are you talking about substitution by bot? --Timeshifter (talk) 03:10, 24 December 2023 (UTC)
 * I mean edits like this, which change import-blanktable to row hover highlight and  to   in the same edit. <b style="font-family:Courier New;">House Blaster </b>talk 03:13, 24 December 2023 (UTC)
 * Around 400 times? How long will that take for you? I think there are bots that can do the separate substitutions automatically. Not sure. --Timeshifter (talk) 03:20, 24 December 2023 (UTC)
 * An hour and a bit? <span id="HouseBlaster:1703391686099:Template_talkFTTCLNRow_hover_highlight" class="FTTCmt"><b style="font-family:Courier New;">House Blaster </b>talk 04:21, 24 December 2023 (UTC)

"Template:Import-blanktable" listed at Redirects for discussion
The redirect [//en.wikipedia.org/w/index.php?title=Template:Import-blanktable&redirect=no Template:Import-blanktable] has been listed at redirects for discussion to determine whether its use and function meets the redirect guidelines. Readers of this page are welcome to comment on this redirect at  until a consensus is reached. <b style="font-family:Courier New;">House Blaster </b> (talk · he/him) 16:09, 14 March 2024 (UTC)