Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Highlight a single column in an array

More
10 years 3 months ago #102017 by jozi
Hi,

I'm currently trying to highlight a column in an array (= question type). For example, I would like to have a red background, or a red border, for one of several response options (= columns) across all items (= rows). Is there any way to accomplish this in LimeSurvery (I am using V 1.92). I would be thankful for any suggestions.

Best,
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 3 months ago - 10 years 3 months ago #102030 by tpartner
Replied by tpartner on topic Highlight a single column in an array
Every table cell has an answer-code-specific class - answer_cell_00[answer code].

So, if you wanted to highlight the column with answer code "2", you could add something like this to the end of template.css (where "12345" is the question code.
Code:
#question12345 .answer_cell_002 {
  background: pink;
}




Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 10 years 3 months ago by tpartner.
The following user(s) said Thank You: jozi
The topic has been locked.
More
10 years 3 months ago #102040 by jozi
Replied by jozi on topic Highlight a single column in an array
Thank you very much, this looks perfect to me. Unfortunately, I was not able to reproduce this with my own survey. I assume this is because I am not familiar with css. What I did is the following: I included the following text at the end of the template.css file:

#page1 .answer_cell_009 {
background: #777777;
border-left: 1px solid black;
}

What I hoped for was that the colum of answer code "9" (as defined in the "edit answer option" menue) for the array question with the code "page1" (as defined in the "edit current question" menue) would be displayed with a grey background and a black border at the left. I was not sure whether it would be necessary to specify the ID of the survey, question group, or question. Note that my question "page1" has 20 subquestions (i.e., rows). Maybe you have an idea what went wrong?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 3 months ago - 10 years 3 months ago #102041 by tpartner
Replied by tpartner on topic Highlight a single column in an array
You need to use the question ID, not code. So, "page1" should be replaced with the question ID.


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 10 years 3 months ago by tpartner.
The topic has been locked.
More
10 years 3 months ago #102049 by jozi
Replied by jozi on topic Highlight a single column in an array
Ok, I see. I tried it again, this time replacing "page1" with "1553" (= the question ID), and also with "question1553" or "ID1553", but it didn't work. I also tried other answer codes (e.g., ".answer_cell_001"), and using another template. Not sure what is going wrong here. Maybe there are some general settings or features of the survey that interfere with this command at the end of the template.css file?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 3 months ago #102051 by tpartner
Replied by tpartner on topic Highlight a single column in an array
If the question ID is 1553, the CSS should be:
Code:
#question12345 .answer_cell_009 {
  background: #777777;
  border-left: 1px solid black;
}


Can you activate a test survey for me to see?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: jozi
The topic has been locked.
More
10 years 3 months ago #102103 by jozi
Replied by jozi on topic Highlight a single column in an array
It is working now! The problem was that I did not activate the survey. After activating it, the effects of changing the css file were visible.

thank you for your help!
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 3 months ago #102106 by holch
Replied by holch on topic Highlight a single column in an array
If the survey is activated or not usually should have no impact on the display of templates and changes in the CSS.

I guess what happened was, that you did not empty the cache and so you saw only the old version, once the survey was activated, you used a different link and the results became visible, because the cache wasn't used.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose