首页 > 解决方案 > 在 twitter bootstrap 中呈现模态表

问题描述

我面临着表格没有在 twitter 引导模式上呈现的问题。我正在做与 jsfiddle ( http://jsfiddle.net/iamakshay04/sh26m80o/2/ ) 中提到的类似的事情。所以为了测试它,我尝试了完全相同的方法,发现 data(table) 呈现在页面上而不是模式上。

<div id="classModal" class="modal fade bs-example-modal-lg" 
     tabindex="-1" role="dialog" aria-labelledby="classInfo" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
          ×
        </button>
        <h4 class="modal-title" id="classModalLabel">
          Class Info
        </h4>
      </div>
      <div class="modal-body">
        <table id="classTable" class="table table-bordered">
          <thead>
          </thead>
          <tbody>
            <tr>
              <td>CLN</td>
              <td>Last Updated Date</td>
              <td>Class Name</td>
              <td># Tests</td>
              <td>Test Coverage (Instruction)</td>
              <td>Test Coverage (Complexity)</td>
              <td>Complex Covered</td>
              <td>Complex Total</td>
              <td>Category</td>
            </tr>
          </tbody>
        </table>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" data-dismiss="modal">
          Close
        </button>
      </div>
    </div>
  </div>
</div>

jQuery:

$('#classModal').modal('show')

CSS:

#classModal {}

.modal-body {
  overflow-x: auto;
}

标签: twitter-bootstrap-3bootstrap-4bootstrap-modal

解决方案


推荐阅读