首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >引导数据库表响应溢出-x不起作用

引导数据库表响应溢出-x不起作用
EN

Stack Overflow用户
提问于 2020-12-28 18:31:11
回答 1查看 46关注 0票数 0

我试图在我的项目中创建自定义引导表,但当我在移动显示中尝试我的代码时。然而,“表”总是将其宽度除以其内容中数据的100%。我想要的是在显示很小时创建一个'table overflow-x‘

代码语言:javascript
复制
  <div class="my-table table-responsive">
    <table class="table my-dark-tb" style="overflow: hidden;">
      <thead class="my-thead-dark">
        <tr>
          <th scope="col">#</th>
          <th scope="col">First Data</th>
          <th scope="col">Second Data</th>
          <th scope="col">Address</th>
          <th scope="col">Phone</th>
          <th scope="col">Action</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row">1</th>
          <td> Lorem ipsum dolor sit amet consectetur. </td>
          <td>Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis consectetur autem quis.</td>
          <td>London</td>
          <td>981638027901</td>
          <td class="my-table-action">
            <a href="#view" class="action-button view">
              <span>Detail</span>
            </a>
            <a href="#edit" class="action-button edit">
              <span>Edit</span>
            </a>
            <a href="#delete" class="action-button delete" data-toggle="modal" data-target="#delete">
              <span>Delete</span>
            </a>
          </td>
        </tr>
        <tr>
          <th scope="row">2</th>
          <td>The quick, brown fox jumps over a lazy dog</td>
          <td>The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog</td>
          <td>Tokyo</td>
          <td>62926281012</td>
          <td class="my-table-action">
            <a href="#view" class="action-button view">
              <span>Detail</span>
            </a>
            <a href="#edit" class="action-button edit">
              <span>Edit</span>
            </a>
            <a href="#delete" class="action-button delete" data-toggle="modal" data-target="#delete">
              <span>Delete</span>
            </a>
          </td>
        </tr>
        <tr>
          <th scope="row">3</th>
          <td>Far far away, behind the word mountains</td>
          <td>far from the countries Vokalia and Consonantia,</td>
          <td>Berlin</td>
          <td>1214123145112</td>
          <td class="my-table-action">
            <a href="#view" class="action-button view">
              <span>Detail</span>
            </a>
            <a href="#edit" class="action-button edit">
              <span>Edit</span>
            </a>
            <a href="#delete" class="action-button delete" data-toggle="modal" data-target="#delete">
              <span>Delete</span>
            </a>
          </td>
        </tr>
      </tbody>
    </table>
  </div>

结果是合适的,但宽度仅为576px

当宽度小于576px时,表格始终采用100%的页面内容(不是溢出x)

如果'table‘中有很多数据,那就成了问题。

EN

回答 1

Stack Overflow用户

发布于 2020-12-28 18:35:28

添加表min-width

代码语言:javascript
复制
.my-dark-tb{
  min-width:1000px;
}

https://jsfiddle.net/lalji1051/m3p80x2e/1/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65476229

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档