Line break within a Boostrap Popover

2

How to make line breaks within a bootstrap popover

Example

  echo"<a href=\"#\" data-toggle='popover' data-title='Popover on Left' data-content='$data <br> $data' data-placement='left'> <span class=\"label label-success\">Print / Send</span></a>";

  //Aqui em    data-content='$data <br> $data'  
  //queria fazer a quebra em linhas mais quando imprimi sai a tag <br> e não quebra

    
asked by anonymous 09.02.2017 / 02:50

1 answer

5

Use the HTML property

To place HTML content within the text or title set the html property to true . View the specification of popover

Example:

$(document).ready(function(){
    $('[data-toggle="popover"]').popover({html: true});   
});
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script><scriptsrc="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h3>Popover Example</h3>
  <ul class="list-inline">
    <li><a href="#" title="Header" data-toggle="popover" data-placement="right" data-content="Content <br> Content">Right</a></li>
  </ul>
</div>

</body>
</html>
    
09.02.2017 / 11:15