1

我使用 ui.bootstrap.modal 尝试了以下操作)。这是我用于 bootstrap.modal 的代码: 在 HTML 文件中:

  <script type="text/ng-template" id="myModalContent.html">
            <div class="modal-header">
                <h3 class="modal-title" id="modal-title">Program Account Checklist!</h3>
            </div>
            <div class="modal-body" id="modal-body">
                        <table>
                            <colgroup span="2"></colgroup>
                            <thead>
                                <tr>
                                <th colspan="2" scope="colgroup">Is your organization:</th>
                                <th>CRA Program Account</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td> checkbot </td>
                                    <td> info </td>
                                    <td> account </td>
                                </tr>
                            </tbody>
                </table>
            </div>
            <div class="modal-footer">
                <button class="btn btn-primary" type="button" ng-click="">Cancel</button>
                <button class="btn btn-primary" type="button" ng-click="">Clear</button>
                <button class="btn btn-primary" type="button" ng-click="">Submit</button>
            </div>
        </script>

在我的 controller.js 中:

 $scope.open = function() {
      var modalInstance = $uibModal.open({
        animation: true,
        ariaLabelledBy: 'modal-title',
        ariaDescribedBy: 'modal-body',
        templateUrl: 'myModalContent.html',
        resolve: {
            items: function () {
              return $scope.checklist;
            }
          },
        size: 'lg'
    })

现在的问题是,当我尝试弹出一个包含表格的窗口时,数据显示在正确的位置,但表格没有任何 ui。一切似乎都在纯文本中。我想这与 type="text/ng-template" 有关。但我想不出一种解决方法。我该如何解决这个问题? 这是我的图片

4

1 回答 1

1

如果我正确理解了您的问题,您在桌子上缺少引导样式吗?,在这种情况下添加一些类名,如下所示:

<table class="table table-borderless">

</table>
于 2018-03-22T20:56:57.293 回答