表到 Bootstrap 弹出窗口

问题描述

我有一个 Bootstrap 弹出窗口,我试图将一个表格放入其中,但是当我点击它时它没有显示因此,我通过参考此链接复制了代码

Putting table into Bootstrap popover

但是表格内容没有出现在我看来,我认为设置有误,所以我不可避免地附上了我设置jquery和bootstrap的链接

    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script type="text/javascript" src="js/bootstrap.js"></script>
    <link rel="stylesheet" href="/css/bootstrap.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
    <script type="text/javascript" src="/js/bootstrap.js"></script>
    <script type="text/javascript">
        $(function(){

        // Enabling Popover Example 2 - JS (hidden content and title capturing)
        $("#popoverExampleTwo").popover({
            html : true,content: function() {
            return $('#popoverExampleTwoHiddenContent').html();
            },title: function() {
            return $('#popoverExampleTwoHiddenTitle').html();
            }
        });
        });
    </script>
    <style>
        .popover {
        max-width: 600px;
        }
    </style>
    <Meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="https://fonts.googleapis.com/css2?family=Acme&family=Noto+Sans+KR&display=swap" rel="stylesheet">
    <title>Book</title>
</head>
<body>
    <div class="span12" style="margin-top: 150px;width:100%">
        <a tabindex="0" role="button" data-trigger="focus" class="btn-sm btn-info" data-placement="top" id="popoverExampleTwo"><i class="fa fa-comments" ></i> View</a>
        <!-- Popover 2 hidden content -->
        <div id="popoverExampleTwoHiddenContent" style="display: none">
           <div>
              <table border="1" style="width:100%">
                 <tr>
                    <th width="30%">Comment date</th>
                    <th width="70%">Comment</th>
                 </tr>
                 <tr>
                    <td>12/03/2015 16:45</td>
                    <td>*Username - Testing1</td>
                 </tr>
                 <tr>
                    <td>12/03/2015 16:55</td>
                    <td>*Username - Testing2</td>
                 </tr>
                 <tr>
                    <td>12/03/2015 17:13</td>
                    <td>*Username - Testing3</td>
                 </tr>
              </table>
           </div>
        </div>
        <!-- Popover 2 hidden title -->
        <div id="popoverExampleTwoHiddenTitle" style="display: none">
           Error comments
        </div>
     </div>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)