使用css隐藏单元格边框

时间:2011-10-25 05:09:23

标签: css border

我想要隐藏表格单元格的边框。 enter image description here

如何使用css做到这一点? 如图所示,我需要隐藏标记的边框(如第三行和第二行)。

5 个答案:

答案 0 :(得分:2)

<style>
table {
    border: 1px solid black;
    width:100%;
}
table tr {
    border: 1px solid black;
}
table th {
    border: none;
}
</style>

<table>
  <thead>
    <tr>
      <th class="col1">1</th>
      <th class="col2">2</th>
      <th class="col3">3</th>
    </tr>
  </thead>
</thead>

见这里:http://jsfiddle.net/AhHFP/

答案 1 :(得分:1)

试试这个

border-collapse:collapse;

答案 2 :(得分:1)

尝试

td.col1
{ 

   border-left:0px;

}

答案 3 :(得分:1)

试试这个。

table {
border: 1px solid black;
width:100%;
border-collapse:collapse;
}

答案 4 :(得分:0)

我假设那是一张桌子?没有标记,它有点难,但把你的桌子设置为表{border-collapse:collapse;} http://reference.sitepoint.com/css/border-collapse