html - 如何减少表格单元格之间的空间?

标签 html css twitter-bootstrap

我正在尝试缩小照片下方姓名行中单元格之间的空间。我已经尝试了所有我能找到的东西,但没有运气。谁能告诉我如何让名字在 table 内靠得更近?我做了一个 fiddle here .我正在使用 bootstrap 3。非常感谢

HTML

<div class="container">

  <div class="col-xs-12 col-md-6 col-sm-8 col-lg-6 center-block animated fadeInUp">

    <div class="results">
      <ul id="results">
        <!-- results appear here -->
        <h3>
 Image title
</h3>
        <div class="dark">
          <a href="page.php?page_id=241"><img src="http://www.fiji.travel/sites/default/files//styles/views-large-thumbnail/public/arial-of-island.jpg?itok=KZHGX6pJ" width="600" class="img-responsive" alt=""></a>
        </div>





        <small>posted by:

                                         <a href="profile.php?user_id=user_id" span="" class="">
                                                Anderson</a></small>

<!-Make These names sit closer together--->
        <table id="myTable2" border="0" cellpadding="0" cellspacing="0" class="table" style="width:auto;">
          <tbody>

            <tr style="\&quot;display:none;\&quot;">
              <td valign="top"><strong><a href="profile.php?user_id=6" class="tags" style="color:">
                                                Anderson,</a>&nbsp;</strong></td>
              <td valign="top"><strong><a href="profile.php?user_id=9" class="tags" style="color:#3cb0fd">
                                                James Bond,</a>&nbsp;</strong></td>
              <td valign="top"><strong><a href="profile.php?user_id=2" class="tags" style="color:">
                                                Julian,</a>&nbsp;</strong></td>
            </tr>
          </tbody>
        </table>
        <hr>

最佳答案

将此添加到您的 CSS:

#myTable2 td {
  padding: 0 0;
}

它将删除您想要删除的填充,并且单元格将彼此相邻。

关于html - 如何减少表格单元格之间的空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40921766/

相关文章:

jquery - 如何在 Bootstrap 中始终在输入旁边放置反馈图标

css - 需要在 bootstrap 中对齐文本

javascript - 在按键上应用滚动动画,使其与鼠标单击时的滚动动画相同

javascript - 在输入旁边添加按钮,水平表单样式 - Bootstrap

javascript - Knockoutjs 不工作

javascript - 获取可拖动元素的 ID

javascript - 如何隐藏表单的一部分并使其仅在单击 "Add another"按钮时可见?

html - 删除 Bootstrap 3 中导航栏按钮的边框

html - 容器不适用于整个内容

javascript - 在 Bootstrap 下拉按钮中显示所选项目