小编Jan*_*gan的帖子

Bootstrap - 调整模态的宽度以适应内容

我只是想知道您是否可以调整模态的宽度以适应它的内容,而不必将 width 属性设置为固定值。我也不想放置水平滚动条。我尝试设置 overflow-x 属性但没有成功。如果可能,我不想为此使用任何 jQuery;只需更改CSS。这是屏幕截图

这是代码:

<!-- Modal -->
<div class="modal fade" id="tableWorklog" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header"> <!--Modal Header -->
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">Member name's Worklog</h4>
      </div> <!-- /header -->
<div class="modal-body"> <!--Modal Body -->
    <table class="table table-striped">
        <thead>
            <tr>
                <th>Task Name</th>
                <th>Location</th>
                <th>Collab</th>
                <th>Description</th>
                <th>Start</th>
                <th>End</th>
                <th>Total</th>
                <th>Type</th>
                <th>Status</th>
                <th>Breaklog</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>task 1</td>
                <td>url</td>
                <td>NONE</td>
                <td>something about the task</td>
                <td>Date + time</td>
                <td>Date + …
Run Code Online (Sandbox Code Playgroud)

html css twitter-bootstrap

2
推荐指数
1
解决办法
5400
查看次数

标签 统计

css ×1

html ×1

twitter-bootstrap ×1