html - 如何在此表的底部添加水平滚动条?

标签 html css scrollbar

该表包含大量列,因此当浏览器恢复时,最后的列对用户是不可见的。我想在表格底部添加一个水平滚动条,以便用户可以拖动它并查看最后一列。

<div class="col-md-12 well">
  <div id="double-scroll">
    <table id="dataGrid" class="dataGrid display dataTable" cellspacing="0" width="100%">
      <thead>
        <tr>
          <th style="display:none;">&nbsp;</th>
          <th>{{ Lang::get('messages.Event_Name') }} </th>
          <th>{{ Lang::get('messages.organization_name') }}</th>
          <th>{{ Lang::get('messages.Event_Start_Date') }} </th>
          <th>{{ Lang::get('messages.Event_End_Date') }} </th>
          <th>{{ Lang::get('messages.Event_Start_Time') }} </th>
          <th>{{ Lang::get('messages.Event_End_Time') }} </th>
          <th>{{ Lang::get('messages.Event_Location') }} </th>
          <th>{{ Lang::get('messages.Event_Venue') }} </th>
          <th>{{ Lang::get('messages.Event_Url') }} </th>
          <th>{{ Lang::get('messages.Created_Date') }} </th>
          <th>&nbsp;</th>
          <th>&nbsp;</th>
          <th>&nbsp;</th>
        </tr>
      </thead>

      <tfoot>
        <tr>
          <th style="display:none;">&nbsp;</th>
          <th>{{ Lang::get('messages.Event_Name') }} </th>
          <th>{{ Lang::get('messages.organization_name') }}</th>
          <th>{{ Lang::get('messages.Event_Start_Date') }} </th>
          <th>{{ Lang::get('messages.Event_End_Date') }} </th>
          <th>{{ Lang::get('messages.Event_Start_Time') }} </th>
          <th>{{ Lang::get('messages.Event_End_Time') }} </th>
          <th>{{ Lang::get('messages.Event_Location') }} </th>
          <th>{{ Lang::get('messages.Event_Venue') }} </th>
          <th>{{ Lang::get('messages.Event_Url') }} </th>
          <th>{{ Lang::get('messages.Created_Date') }} </th>
          <th>&nbsp;</th>
          <th>&nbsp;</th>
          <th>&nbsp;</th>
        </tr>
      </tfoot>

      <tbody id="mailTableBody">
        @foreach ($liveEvents as $value)
        <tr role="row" class="odd">
          <td style="display:none;" class="sorting_1">{{ $value->id }}</td>
          <td>{{ $value->eventName }}</td>
          <td>{{ $value->organizationName }}</td>
          <td>{{ $value->startDate }}</td>
          <td>{{ $value->endDate }}</td>
          <td>{{ $value->startTime }}</td>
          <td>{{ $value->endTime }}</td>
          <td>{{ $value->location }}</td>
          <td>{{ $value->Venue }}</td>
          <td><a class="btn btn-danger" style ="height: 32px;" href="{{ $value->publicURL }}" >{{Lang::get('messages.register')}}</a></td>
          <td>{{ $value->created_at }}</td>

          <td><button onclick="watchnow(this)" class="btn btn-success" style ="width: 150px; float: right" >{{Lang::get('messages.watchnow')}}</button></td>
        </tr>
        @endforeach
      </tbody>
    </table>
  </div>
</div>

最佳答案

找到最佳答案..

<style type="text/css">
    #double-scroll { overflow: auto; overflow-y: hidden; }
    #double-scroll p { margin: 0; padding: 1em; white-space: nowrap; }
</style>

关于html - 如何在此表的底部添加水平滚动条?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30701000/

相关文章:

c# - 如何设置ListBox的Scrollbar位置?

javascript - Modernizr.mq 事件多次触发

html - Firefox for Mac 在子元素后面显示滚动条

html - 标题/导航栏中 Logo 居中

html - 为什么我不能使用 CSS 来移动按钮?

html - 第二个 Bootstrap 导航栏与第一个导航栏的下拉菜单重叠?

css - 当所有内容都包含在 div 中时获取水平滚动条

javascript - 用js检测网站访问是否是新的

php - 页面刷新时如何停止将数据重新输入数据库

android - 如何设置ListView的滚动条向右偏移