引导表仅在内部有边框

问题描述 投票:0回答:1

我希望使用 Bootstrap 创建一个表格,但该表格必须仅在内部有边框。有一些想法吗? 如果可能的话我不想使用css而只想使用html和Bootstrap。 谢谢。

最后我想实现这个: Table

css html bootstrap-modal
1个回答
4
投票

这非常麻烦,但这是我使用 Bootstrap 的边框实用程序类得到的最好的https://getbootstrap.com/docs/4.1/utilities/borders/

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
  <title>Overlay</title>
</head>
<body>
  <div class="container">
  <table class="table" style="margin-top: 10px;">
  <thead>
    <tr>
      <th scope="col" class="border-top-0 border-right border-bottom-0">#</th>
      <th scope="col" class="border-top-0 border-right border-bottom-0">First</th>
      <th scope="col" class="border-top-0 border-right border-bottom-0">Last</th>
      <th scope="col" class="border-top-0 border-right border-bottom-0 border-right-0">Handle</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td scope="row" class="border-right border-bottom-0">1</td>
      <td class="border-right border-bottom-0"> Mark</td>
      <td class="border-right border-bottom-0">Otto</td>
      <td class="border-right border-bottom-0 border-right-0">@mdo</td>
    </tr>
    <tr>
      <td scope="row" class="border-right border-bottom-0">1</td>
      <td class="border-right border-bottom-0"> Mark</td>
      <td class="border-right border-bottom-0">Otto</td>
      <td class="border-right border-bottom-0 border-right-0">@mdo</td>
    </tr>
    <tr>
      <td scope="row" class="border-right border-bottom-0">1</td>
      <td class="border-right border-bottom-0"> Mark</td>
      <td class="border-right border-bottom-0">Otto</td>
      <td class="border-right border-bottom-0 border-right-0">@mdo</td>
    </tr>
  </tbody>
</table>
</div>

</body>

看到这个小提琴

© www.soinside.com 2019 - 2024. All rights reserved.