How to adjust where I can add white space (or repeat headers) | XM Community
Skip to main content

In the question that appears in the attached image, I have 19 items in total. The list is quite long, so I would like to add white spaces in between. The issue here is that I want to adjust the spacing manually (e.g. adding the space after every 3 items), but the current format doesn't seem to support that. Neither does it work for 'repeat headers' option. Can you please let me know how I can do it? 
I would like to at least avoid adding white spaces on weird lines, because right now, the Qualtrics automatically add white spaces after every 5 lines and therefore, substantively related items get cut off in a weird manner (e.g. items #5 and #6) and I would like to avoid that. Any tips on how to adjust the location of white spaces would be very much appreciated. Thanks a lot in advance!
Screen Shot 2021-02-09 at 2.05.10 AM.png

You can take a look at his question: http://bit.ly/QUALTMATROW


Screen Shot 2021-02-09 at 4.55.51 PM.pngThank you so much for the link, I really appreciate it!!
When I tried to apply the code as instructed, however, the code doesn't seem to work and I don't get any white spaces on the lines that I would like them to be.
1) Can you please let me know what mistake I may be making? For your reference, I've attached the script that I modified from your example and used.
2) If I were to add a white space on line 4 and a header on line 7, is it correct to write a code as follows?
new_row = choice_table.insertRow(4);
new_row = choice_table.insertRow(7);
new_row.innerHTML = choice_table.rowsr0].innerHTML;
I would be very grateful for your reply. Thanks so much again in advance!


According to the screenshot, the problem is that the new rows you are creating are empty. So the browser is just ignoring them and there is no space being added.
Suppose you want to add some whitespace at the 4th row, you first create a row over there and then give it some some content with a line like this:

new_row.innerHTML = " "

You'll need to repeat this for every new row that you create.
For your question 2, largely its okay. But the problem is that, after inserting a row at index 4, the row which was at index 7 has now moved to index 8. So just take not of how many rows you have added and the new index. I usually start from the bottom to avoid this. But you can do it however, you prefer.


Wow, yes, after applying your suggestions, things work out really well!!! Thank you so much for the detailed guidance on how to apply the code - it's so amazing!!! Really appreciate it!!! 🙂!!


Leave a Reply