Use markdown to render column title in several lines
Open in new window

SurveyJS supports markdown via onTextMarkDown event. You may use any JavaScript markdown library. In this example, we are using Showdown markdown. You may use all features that this or other libraries have.

Survey.Survey.cssType = "bootstrap";
Survey.defaultBootstrapCss.navigationButton = "btn btn-green";

window.survey = new Survey.Model({
   questions: [
     type: "matrix",
     name: "factors",
     title: "Please indicate how **important** *these factors* are when deciding on your vacation destination?",
     columns: [{value: 1, text: "Not <br /> important <br /> 1"}, 
        {value: 2, text: "<br /><br />2"}, 
        {value: 3, text: "<br /><br />3"}, 
        {value: 4, text: "<br /><br />4"}, 
        {value: 5, text: "<br /><br />5"}, 
        {value: 6, text: "<br /><br />6"}, 
        {value:7, text: "Very<br /> important <br /> 7"}],
     rows: [
        {value: "luxuries", text: "*Indulgent luxuries*"},
        {value: "beaches", text: "Quality beaches"},
        {value: "cultural", text: "*Cultural activities*"},
        {value: "cuisine", text: "Unique cuisine",},
        {value: "wildlife", text: "*Interaction with local wildlife*"},
        {value: "nightlife", text: "Nightlife"},
        {value: "shopping", text: "*Shopping*"}
survey.onComplete.add(function(result) {
	document.querySelector('#surveyResult').innerHTML = "result: " + JSON.stringify(;

//Create showdown mardown converter
var converter = new showdown.Converter();
survey.onTextMarkdown.add(function(survey, options){
    //convert the mardown text to html
    var str = converter.makeHtml(options.text);
    //remove root paragraphs <p></p>
    str = str.substring(3);
    str = str.substring(0, str.length - 4);
    //set html
    options.html = str;

var myCss = { matrix: {root: "table table-striped"}};

$("#surveyElement").Survey({model:survey, css: myCss});

<!DOCTYPE html>

    <title>Welcome to JQuery</title>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="./index.css">

    <div id="surveyElement"></div>
    <div id="surveyResult"></div>
    <script src="./index.js"></script>


.btn-green {
  background-color: #1ab394;
  color: #fff;
  border-radius: 3px;

.btn-green:hover, .btn-green:focus {
    background-color: #18a689;
    color: #fff;

.panel-footer {
    text-align: right;
    background-color: #fff;