hide cells border using css

瘦欲@ 提交于 2020-02-06 03:52:44

问题


I want to hide border of cell of a table .

How to do it using css ? As it shows, I need to hide the marked borders (as in third and second rows).


回答1:


<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>

See here: http://jsfiddle.net/AhHFP/




回答2:


try this

border-collapse:collapse;



回答3:


try

td.col1
{ 

   border-left:0px;

}



回答4:


try this.

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



回答5:


i'm assuming thats a table? without markup, its kinda hard but set your table to table{border-collapse: collapse;} http://reference.sitepoint.com/css/border-collapse



来源:https://stackoverflow.com/questions/7884934/hide-cells-border-using-css

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!