只有内部边框的Bootstrap表

时间:2018-05-26 16:08:42

标签: css html5 bootstrap-modal

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

最后我想实现这个: Table

1 个答案:

答案 0 :(得分:1)

它非常麻烦,但这是我得到的最好的。 使用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>

请参阅此fiddle

相关问题