为什么TR不采取风格? [英] Why TR not taking style?

查看:123
本文介绍了为什么TR不采取风格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CSS

  table tr {border-bottom:1px solid#008999} 



HTML

 < table width = 100%cellspacing =0cellpadding =0> 
< thead>
< tr>
< th scope =col>一< / th>
< th scope =col>两个< / th>
< th scope =col>三< / th>
< / tr>
< / thead>
< tbody>
< tr>
< th scope =row> Hello< / th>
< td>& nbsp;< / td>
< td>& nbsp;< / td>
< / tr>
< / tbody>
< / table>


解决方案

添加:

 
{
border-collapse:collapse;
}

否则 tr < a href =https://www.w3.org/TR/REC-CSS2/tables.html#borders>不会创建任何单一屏蔽。



简单示例:



  table {border:5px solid# background:#fff;} tr {border:5px solid#090;} td {background:#ccc; padding:5px 0;} table + table {border-collapse:collapse;}  

 < table> < tr& < td> def< / td> < td> ault< / td> < / tr>< / table>< table> < tr> < td> coll< / td> < td> apse< / td> < / tr>< / table>  


CSS

table tr {border-bottom:1px solid #008999}

HTML

<table width="100%" cellspacing="0" cellpadding="0">
   <thead>
      <tr>
         <th scope="col">one</th>
         <th scope="col">two</th>
         <th scope="col">three</th>
      </tr>
   </thead>
   <tbody>
      <tr>
         <th scope="row">Hello</th>
         <td>&nbsp;</td>
         <td>&nbsp;</td>
      </tr>
   </tbody>
</table>

解决方案

Add:

table
{
    border-collapse: collapse;
}

Otherwise tr creates no single block.

Simple example:

table
{
  border: 5px solid #900;
  background: #fff;
}
tr
{
  border: 5px solid #090;
}
td
{
  background: #ccc;
  padding: 5px 0;
}

table + table
{
  border-collapse: collapse;
}

<table>
  <tr>
    <td>def</td>
    <td>ault</td>
  </tr>
</table>
<table>
  <tr>
    <td>coll</td>
    <td>apse</td>
  </tr>
</table>

这篇关于为什么TR不采取风格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆