gpt4 book ai didi

html - 如何在启用 bootstrap 的 html 表的元素之间添加间距?

转载 作者:太空宇宙 更新时间:2023-11-04 13:40:35 25 4
gpt4 key购买 nike

这把 fiddle :https://jsfiddle.net/DTcHh/10952/显示 8 个表格元素,但我无法在每个元素之间添加间距。

我试过了:

cellpadding="3" cellspacing="3" 

还有:

td:nth-child(2) {
padding-right: 20px;
}

但这些选项似乎并没有达到预期的效果。

<div class="center">

<div>
<table class="table table-bordered" cellspacing="1">
<tr>
<td class="col-md-3">
<div class="header"><a href="{{ module.hrefTitle }}" target="_blank">test2</div>

<div class="title truncated-anchors"><a title="{{module.title}}" href='test");'>test</a>
</div>

<div class="date">test</div>
</td>

<td class="col-md-3" col-md-offset-2>
<div class="header"><a href="{{ module.hrefTitle }}" target="_blank">test2</div>

<div class="title truncated-anchors"><a title="{{module.title}}" href='test");'>test</a>
</div>

<div class="date">test</div>
</td>

<td class="col-md-3">
<div class="header"><a href="{{ module.hrefTitle }}" target="_blank">test2</div>

<div class="title truncated-anchors"><a title="{{module.title}}" href='test");'>test</a>
</div>

<div class="date">test</div>
</td>




<td class="col-md-4">
<div class="header"><a href="{{ module.hrefTitle }}" target="_blank">test2</div>

<div class="title truncated-anchors"><a title="{{module.title}}" href='test");'>test</a>
</div>

<div class="date">test</div>
</td>
</tr>

<tr>
<td class="col-md-3">
<div class="header"><a href="{{ module.hrefTitle }}" target="_blank">test2</div>

<div class="title truncated-anchors"><a title="{{module.title}}" href='test");'>test</a>
</div>

<div class="date">test</div>
</td>

<td class="col-md-3" col-md-offset-2>
<div class="header"><a href="{{ module.hrefTitle }}" target="_blank">test2</div>

<div class="title truncated-anchors"><a title="{{module.title}}" href='test");'>test</a>
</div>

<div class="date">test</div>
</td>

<td class="col-md-3">
<div class="header"><a href="{{ module.hrefTitle }}" target="_blank">test2</div>

<div class="title truncated-anchors"><a title="{{module.title}}" href='test");'>test</a>
</div>

<div class="date">test</div>
</td>




<td class="col-md-4">
<div class="header"><a href="{{ module.hrefTitle }}" target="_blank">test2</div>

<div class="title truncated-anchors"><a title="{{module.title}}" href='test");'>test</a>
</div>

<div class="date">test</div>
</td>
</tr>

</table>
</div>

</div>

最佳答案

尝试添加以下内容:

table {
border-collapse: separate;
border-spacing: 1em;
}

关于html - 如何在启用 bootstrap 的 html 表的元素之间添加间距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31953085/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com