Highlight a single column in an array

More
3 years 11 months ago #102017 by jozi
jozi created the topic: Highlight a single column in an array
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,

Please Log in to join the conversation.

More
3 years 11 months ago - 3 years 11 months ago #102030 by tpartner
tpartner replied the 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.
#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.
Attachments:
Last Edit: 3 years 11 months ago by tpartner.
The following user(s) said Thank You: jozi

Please Log in to join the conversation.

More
3 years 11 months ago #102040 by jozi
jozi replied the 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?

Please Log in to join the conversation.

More
3 years 11 months ago - 3 years 11 months ago #102041 by tpartner
tpartner replied the 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.
Attachments:
Last Edit: 3 years 11 months ago by tpartner.

Please Log in to join the conversation.

More
3 years 11 months ago #102049 by jozi
jozi replied the 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?

Please Log in to join the conversation.

More
3 years 11 months ago #102051 by tpartner
tpartner replied the topic: Highlight a single column in an array
If the question ID is 1553, the CSS should be:
#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

Please Log in to join the conversation.

More
3 years 11 months ago #102103 by jozi
jozi replied the 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!

Please Log in to join the conversation.

More
3 years 11 months ago #102106 by holch
holch replied the 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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!