Welcome to the LimeSurvey Community Forum

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

Fixing the header of an array table

  • nadica123
  • nadica123's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 day 15 hours ago #267962 by nadica123
Fixing the header of an array table was created by nadica123
Please help us help you and fill where relevant:
LimeSurvey version: 6.3.4
Own server or LimeSurvey Cloud: own
Survey theme/template: fruity
==================
(Write here your question/remark)

Hello, 

I have a question as an array table, which is quite long, and I need the header to be fixed, so when the page is scrolled down, the header is always visible.

I tried with three different options but none worked (I found some of them via previous discussions):

clicking sticky headers option in the theme settings of my survey
via css:   gitlab.com/SondagesPro/SurveyThemes/skel...5148271722_6377_6380

and also another version of the css: 

.ls-heading.ls-header {
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  
.thead.th {
  position: sticky;
  top: 0;
  z-index: 1000; 
  background-color: #ffffff; 
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1); 
}

and html:

document.addEventListener("DOMContentLoaded", function () {
  const table = document.querySelector(".ls-answers.table-bordered"); 
  const thead = table.querySelector("thead"); // 


  thead.style.position = "sticky";
  thead.style.top = "0";
  thead.style.zIndex = "1000"; 
  thead.style.backgroundColor = "#ffffff"; 
});

none of these worked and I'm not sure what else I can try. Would appreciate if someone can provide some guidance here.

Thank you.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 day 12 hours ago #267970 by Joffm
Replied by Joffm on topic Fixing the header of an array table
Hi, sorry I can't  spolve your problem at the moment,
BUT

I have a question as an array table, which is quite long, and I need the header to be fixed, so when the page is scrolled down, the header is always visible.

Long arrays are the most common reason for dropouts. They are the most boring way to ask questions.
Even the need to scroll makes participants less interested .
Therefore:
Split the question,
give participants feedback,
give them time to catch their breath

Read this
 

File Attachment:

File Name: surveyfrie...1-19.zip
File Size:977 KB


Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose