从另一个表中的表中删除边框

时间:2017-04-21 20:43:24

标签: html css

出于某种原因,我需要一张表格中的表格。父表的每个都有一个边框,但最后一个<tr>。子表应该没有边框。然而,我无法通过CSS删除它们。尝试了几个我能找到的解决方案,但没有一个对我有用。奇怪的是,CSS的其余部分出现了,只有边界是持久的......

&#13;
&#13;
.table_wrapzm {
  border-collapse: collapse;
  font-family: Arial, Helvetica;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.table_wrapzm tr {
  border-bottom: 1px solid #ddd;
}

.table_wrapzm .h3 {
  font-size: large;
  font-weight: bold;
  text-align: center;
}

.table_wrapzm .bron {
  font-size: small;
  text-align: left;
  color: #ddd;
}

.table_wrapzm a:link {
  color: #ddd;
}

.table_wrapzm a:visited {
  color: #ddd;
}

.table_wrapzm a:hover {
  color: black;
}

.table_wrapzm a:active {
  color: #ddd;
}

.table_wrapzm td {
  padding-bottom: 3px;
}

.table_wrapzm tr:last-child {
  border-bottom: none;
}

.table_wrapzm .main {
  padding: 10px 0 10px 0;
}


/* tabel inside table */

.table_zm {
  border: none !important;
  background: black;
  color: white;
  font-family: Arial, Helvetica;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.table_zm .h3 {
  font-size: large;
  font-weight: bold;
}

.table_zm td {
  padding: 3px;
}
&#13;
<table class="table_wrapzm">
  <tr>
    <td class="h3">Title</td>
  </tr>
  <tr>
    <td class="main">
      <table class="table_zm">
        <tr>
          <td>Row 1 col 1</td>
          <td>Row 1 col 2</td>
          <td>row 1 col 3</td>
          <td>Row 1 col 4</td>
          <td>row 1 col 5</td>
        </tr>
        <tr>
          <td>Row 2 col 1</td>
          <td>&nbsp;</td>
          <td>row 2 col 3</td>
          <td>&nbsp;</td>
          <td>row 2 col 5</td>
        </tr>
        <tr>
          <td>row 3 col 1</td>
          <td colspan="3">&nbsp;</td>
          <td>Row 3 col 5</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td> source</td>
  </tr>
</table>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

.table_zm td { border: 0 none; }

正如@skobaljic所做的那样。非常感谢!