【发布时间】:2018-06-27 17:16:11
【问题描述】:
我在表头中使用默认引导工具提示。它显示了不相关的行为,例如 - 它增加了标题的宽度。
这里是codepen链接
https://codepen.io/tumulalmamun/pen/mpQzBV
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
<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.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h3>Tooltip Example</h3>
<p>The data-placement attribute specifies the tooltip position.</p>
<div class="row">
<div class="col-lg-3">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr><th colspan="2"> status (Overall)</th></tr>
<tr>
<th colspan="2" data-toggle="tooltip" data-placement="right" title="Hooray!">
Pending
</th>
</tr>
<tr>
<th data-toggle="tooltip" data-placement="right" title="Hooray!">M</th>
<th data-toggle="tooltip" data-placement="right" title="Hooray!">O</th>
</tr>
</thead>
</table>
</div>
<div class="col-lg-3"></div>
<div class="col-lg-3"></div>
</div>
</div>
</body>
</html>
【问题讨论】:
-
您的 codepen 与 Bootstrap 4 无关(正如您的标签所暗示的那样)。
-
感谢您的指出。我正在尝试仅添加引导程序,但它没有在引导程序上显示建议。所以我接受了。
标签: html css twitter-bootstrap bootstrap-4 tooltip