Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Modifiying CSS: .array-flexible-column

Modifiying CSS: .array-flexible-column 3 years 8 months ago #56444

  • jalatiphra
  • jalatiphra's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
Hi iam trying to modify the .array-flexible-column class ( i think thats what it is called )
in the template.css of the mind_idea template

current state is : the colums are alternating in color.
i want this for the rows . but i cant get it to work

.array-flexible-column col.odd,.array-flexible-column th.odd {
background-color: #0c1c2b;
padding: 0% 0.3em;
}
this is the part for the colums... as iam not very experienced with CSS i dont know any of the vocabulary ;)
i would assume it would be something like this:
.array-flexible-column row.odd,.array-flexible-column td.odd {
background-color: #0c1c2b;
padding: 0% 0.3em;
}
but thats not working :(
any ideas?
The administrator has disabled public write access.

Re: Modifiying CSS: .array-flexible-column 3 years 8 months ago #56446

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2838
  • Thank you received: 356
  • Karma: 123
Are you sure that in your mind_idea template the columns are alternating in color??

This happens for me only when I use the question type "Array by column".
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: Modifiying CSS: .array-flexible-column 3 years 8 months ago #56450

  • jalatiphra
  • jalatiphra's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
iam sorry, i think i made it clear that i infact am using Array by column

but i dont want the standart column color alternation.
i just want array by column with standart array appearance
The administrator has disabled public write access.

Re: Modifiying CSS: .array-flexible-column 3 years 8 months ago #56452

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2838
  • Thank you received: 356
  • Karma: 123
Excuse my ignorance, but what is the point to use the array by column when you want it to look like a normal array afterwards? I think I am not really getting it. Wouldn't a normal Array do the job then? Because the background color follows a logic. Whenever it is the same background color, there is only one choice possible. So if you use the Array by column it is usually because you want to give the possibility to only choose one of the options per column, while for the normal array questions there is only one choice per line possible.

My solution would be to use a normal array question, but maybe I am overlooking something here? ;-)
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: Modifiying CSS: .array-flexible-column 3 years 8 months ago #56453

  • jalatiphra
  • jalatiphra's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
my anwers are full text so i need them in rows not in colums. obvious problem?

but my anwers are of different length - so i need to distinguish rows.

my questions therefore are very short and fit fine in the columns
The administrator has disabled public write access.

Re: Modifiying CSS: .array-flexible-column 3 years 8 months ago #56456

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2838
  • Thank you received: 356
  • Karma: 123
Ahh, OK, I think i got it. So you want the functionality of "Array by column" (only one option per column can be checked), but you want it to look like a normal array question with the rows being highlighted in different color, right?
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: Modifiying CSS: .array-flexible-column 3 years 8 months ago #56459

  • jalatiphra
  • jalatiphra's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
exactly
The administrator has disabled public write access.

Re: Modifiying CSS: .array-flexible-column 3 years 8 months ago #56463

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4266
  • Thank you received: 803
  • Karma: 368
The problem here is that there are no "odd" or "even" classes applied to rows in array-flexible-column questions, only to the columns.

A solution would be to use JavaScript to apply new classes to the rows and then style them with CSS.

Add the following to the end of template.js:
$(document).ready(function(){
		$('.array-flexible-column table.question tbody tr:nth-child(odd)').addClass('oddRow');
		$('.array-flexible-column table.question tbody tr:nth-child(even)').addClass('evenRow');  
	})

And then something like this in template.css:
.array-flexible-column col.odd,
.array-flexible-column th.odd {
	background-color: transparent;
}
 
.array-flexible-column .oddRow {
	background-color: #0C1C2B;
}
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Modifiying CSS: .array-flexible-column 3 years 8 months ago #56465

  • jalatiphra
  • jalatiphra's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
thank you very much, that looks reasonable.
ill give it a try tomorrow and set this to solved if it works
The administrator has disabled public write access.

Aw: Re: Modifiying CSS: .array-flexible-column 3 years 8 months ago #56504

  • jalatiphra
  • jalatiphra's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
exactly what i needed thank you

set to solved

hmm i cant set the topic to solved because iam unable to edit it :(
Last Edit: 3 years 8 months ago by jalatiphra.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.130 seconds
Donation Image