- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Highlight a single column in an array
- jozi
- Topic Author
- Offline
- New Member
Less
More
10 years 5 months ago #102017
by jozi
Highlight a single column in an array was created 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,
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10116
- Thank you received: 3597
10 years 5 months ago - 10 years 5 months ago #102030
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
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.
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.
Attachments:
Last edit: 10 years 5 months ago by tpartner.
The following user(s) said Thank You: jozi
The topic has been locked.
- jozi
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
10 years 5 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?
#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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10116
- Thank you received: 3597
10 years 5 months ago - 10 years 5 months ago #102041
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Highlight a single column in an array
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last edit: 10 years 5 months ago by tpartner.
The topic has been locked.
- jozi
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
10 years 5 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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10116
- Thank you received: 3597
10 years 5 months ago #102051
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Highlight a single column in an array
If the question ID is 1553, the CSS should be:
Can you activate a test survey for me to see?
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.
- jozi
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
10 years 5 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!
thank you for your help!
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11683
- Thank you received: 2748
10 years 5 months ago #102106
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
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 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.