试图添加细胞数据时细胞边界丢失< td> [英] Cell border lost when trying to add cell data <td>

查看:73
本文介绍了试图添加细胞数据时细胞边界丢失< td>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


当我尝试将'dotgreen'as单元格数据添加到我的表格时,单元格边框消失了。我究竟做错了什么?请帮忙!

以下是HTML废料:
< tr>
< td>可定制的模块化内饰< / td>
< td class =dotorange>< / td>
< td>< / td>
< td>< / td>
< td>< / td>
< td>< / td>
< td class =dotred>< / td>
< / tr>

这是CSS dotgreen属性:
.dotgreen {
height:2px;
宽度:2px;
margin-left:20%;
margin-right:auto;
background-color:green;
border-radius:50%;
display:inline-block;
}





我的尝试:



尝试增加宽度,在css中加深球的高度和宽度。

解决方案

在HTML中,你是添加类

 dotred 

但在css中添加

 .dotgreen 

所以我觉得css不是call.please更改类名。


单元格边框不会消失;它只是成为点的一部分。您将 border-radius 应用于表格单元格,因此其边框变为圆形。



如果您希望点出现在单元格中,您需要将该类应用于单元格中的元素:

  <   td  >  <   div     class   =  dotgreen >  <   / div  >  <   / td  >  


Hi,
When I try to add 'dotgreen'as cell data to my table, the cell border disappears. What am i doing wrong? Please help!

Here is the HTML scrap:
 <tr>
             <td>Customisable modular interiors</td>
             <td class="dotorange"></td>   
             <td></td>
             <td></td>
             <td></td>
             <td></td>
             <td class="dotred"></td>   
       </tr> 

Here is the CSS dotgreen property:
.dotgreen{
  height: 2px;
  width: 2px;
  margin-left: 20%;
  margin-right: auto;
  background-color: green;
  border-radius: 50%;
  display: inline-block;
}



What I have tried:

tried increasing the width of the , deecreasing the ball height and width in css.

解决方案

In HTML your are add class

dotred

but in css your adding

.dotgreen

so i feel css is not call.please change class name.


The cell border doesn't disappear; it just becomes part of the "dot". You're applying the border-radius to the table cell, so its borders become round.

If you want the dot to appear within the cell, you'll need to apply the class to an element within the cell:

<td><div class="dotgreen"></div></td>


这篇关于试图添加细胞数据时细胞边界丢失&lt; td&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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