Last active
October 23, 2022 16:54
-
-
Save marketinview/e3a9d10a133ce525d478 to your computer and use it in GitHub Desktop.
Qualtrics: Two Column Matrix Labels. Use the following CSS to change Matrix row labels into two columns. The optional JavaScript can be used to label the columns. #qualtrics #css #js #jq #matrix #label #column
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style type="text/css"> | |
.wrap { | |
width:300px; | |
margin:0 auto; | |
float:left; | |
} | |
.left_col { | |
float:left; | |
width:240px; | |
text-align:left; | |
} | |
.right_col { | |
float:right; | |
width:60px; | |
text-align:center; | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="wrap"><div class="left_col">Label1</div><div class="right_col">Label2</div></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qualtrics.SurveyEngine.addOnload(function() { | |
var leftLabel = "Left"; | |
var rightLabel = "Right"; | |
//No changes below | |
var r1c1 = jQuery("#"+this.questionId+" .c1:first"); | |
r1c1.removeAttr("width"); | |
r1c1.html("<div class='wrap'><div class='left_col'>"+leftLabel+"</div><div class='right_col'>"+rightLabel+"</div></div>"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See additional Qualtrics solutions at: https://qualtricswiki.tgibbons.com/doku.php