You are here: Foswiki>Tasks Web>Item13143 (23 Dec 2014, GeorgeClark)Edit Attach

Item13143: CSS cell coloring code works as expected in TWIki, fails in Foswiki

Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release: n/a
Applies To: Engine
Reported By: VickiBrown
Waiting For:
Last Change By: GeorgeClark
I have JavaScript / CSS code that is designed to change the background-color of a table cell (<td>) based on the text content of the cel. This code works in TWIki (4, 5 and 6) but fails in Foswiki (initially tested in 1.1.4. No change in 1.1.9).

Apparently Foswiki's default CSS for the table row is overriding the CSS class defined for the cell.

I filed a support request (Question1174) which was answered thusly:

You can try to use .foswikiTable tr td.cell_yellow. Otherwise add !important to override:
.cell_yellow {
background-color: #FF4 !important;
text-align: center !important;

-- ArthurClemens - 30 Sep 2012

This does work. However, it shouldn't be necessary and it violates the Principle of Least Surprise.

Given that
  1. the CSS works in TWiki b. CSS customization is a big feature of TWiki and Foswiki

I think the user should not need to jump through hoops (and look up old support requests online) to make their CSS code work.

-- VickiBrown - 15 Dec 2014


ItemTemplate edit

Summary CSS cell coloring code works as expected in TWIki, fails in Foswiki
ReportedBy VickiBrown
Codebase 1.1.9
SVN Range
AppliesTo Engine
Priority Normal
CurrentState Confirmed
TargetRelease n/a
ReleasedIn n/a
Topic revision: r2 - 23 Dec 2014, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy