title: How to add new line in bootstrap modal box
body: <p>I wrote an code to display json data in bootstrap table..Here how can add a new line in modal-box.. and is it possible to add title along with data in modal-box.. </p>
  
  <p><strong>For example :</strong></p>
  
  <p><strong>Reg.NO:</strong> 1122340</p>
  
  <p><strong>Student Name:</strong> john</p>
  
  <p><strong>Department:</strong> CSE</p>
  
  <p><strong>Yop:</strong> 2016</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    &lt;!DOCTYPE html&gt;
      &lt;html&gt;
      &lt;head&gt;
         &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"&gt;
         &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"&gt;&lt;/script&gt;
         &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"&gt;&lt;/script&gt;
         
      &lt;script&gt;
      var studentDetails=[
      {
      "regno":"1122340",
      "name":"John",
      "dept":"CSE",
      "yop": "2016",
      "action":"Show"
      },
      {
      "regno":"1122341",
      "name":"Brisen",
      "dept": "MECH",
      "yop":"2015",
      "action":"Show"
      },
      {
      "regno":"1122342",
      "name":"Moksha",
      "dept": "EEE",
      "yop":"2016",
      "action":"Show"
      },
      {
      "regno":"1122343",
      "name":"Mano",
      "dept": "IT",
      "yop":"2013",
      "action":"Show"
      },
      {
      "regno":"1122344",
      "name":"Jothish",
      "dept": "AERO",
      "yop":"2012",
      "action":"Show"
      }
      ];
      
      $(document).ready(function(){
      
      for(var i=0;i&lt;studentDetails.length;i++)
      {
        var tab='&lt;tr&gt;&lt;td&gt;'+ studentDetails[i].regno +"\n"+'&lt;/td&gt;&lt;td&gt;'+ studentDetails[i].name +"\n"+'&lt;/td&gt;&lt;td&gt;'+
         studentDetails[i].dept +"\n"+'&lt;/td&gt;&lt;td&gt;'+ studentDetails[i].yop +"\n"+'&lt;/td&gt;&lt;td&gt;&lt;button class="show" data-toggle="modal"  data-target="#myModal" data-html="true"&gt;'+
          studentDetails[i].action +'&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;';
          $('#student').append(tab)
      };
      $(".show").click(function(){
      $(".modal-body").html('');
      res=$(this).closest('tr').clone().find('button').remove().end().text();
      $(".modal-body").append(res);
      });
      }); 
      &lt;/script&gt;
      
      &lt;/head&gt;
      &lt;body&gt;
      
          &lt;div class="container"&gt;
            &lt;div class="modal fade" id="myModal" role="dialog"&gt;
              &lt;div class="modal-dialog"&gt;
                &lt;div class="modal-content"&gt;
                  &lt;div class="modal-header"&gt;
                    &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                    &lt;h4 class="modal-title"&gt;Student Details&lt;/h4&gt;
                    &lt;/div&gt;
                    &lt;div class="modal-body"&gt;
                    &lt;/div&gt;
                    &lt;div class="modal-footer"&gt;
                    &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;table class="table table-striped" id="student"&gt;
           &lt;tr&gt;
           &lt;th&gt;Register No&lt;/th&gt;
           &lt;th&gt;Student Name&lt;/th&gt;
           &lt;th&gt;Department&lt;/th&gt;
           &lt;th&gt;Year Of Passed Out&lt;/th&gt;
           &lt;th&gt;Action&lt;/th&gt;
           &lt;/tr&gt;
          &lt;/table&gt;
      
      &lt;/body&gt;
      &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>