首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何隐藏两个单元格相交且其中一个单元格具有行跨度的表格边框

问如何隐藏两个单元格相交且其中一个单元格具有行跨度的表格边框
EN

Stack Overflow用户
提问于 2018-01-09 18:10:18
回答 1查看 81关注 0票数 1

我有这个表,第一列有一个行跨度,我想隐藏第一列和最后一行之间共享的边框!在右边的图片中,你可以看到我想要它!

​

​

我不知道你怎么能只隐藏边框的一部分,我试着让底部的左边框变得透明,希望它能覆盖第一列的边框,但它不起作用!

这个是可能的吗?

最下面一行的CSS:

代码语言:javascript
复制
    #detailYear .blackBorderPrintLeft {
    padding: 15px;
    font-size: 20px;
    vertical-align: middle;
    border-color: #000 !important;
    border-top: 1px solid !important;
    border-bottom: 1px solid !important;
    border-left: 0px solid rgba(255, 255, 255, 0.00) !important;
}

左行跨度的CSS:

代码语言:javascript
复制
#detailYear .yearCellVertical {
    height: 140px;
    white-space: nowrap;
    width: 5%;
    border-color: #000;
    border-right: 1px solid;
    border-bottom: 1px solid;
}
    #detailYear .yearCellVertical > div {
        transform: translate(3px, 31px) rotate(270deg);
        width: 35px;
        text-align: center;
        vertical-align: middle;
        font-weight: bold;
        font-size: 35px;
    }
        #detailYear .yearCellVertical > div > span {
            padding: 5px 10px;
        }

整个表格的CSS (我有表格边框的bootstrap类,但不得不去掉它并手动给出边框,因为底部行的上边框没有显示出我想要的更粗的黑色边框):

代码语言:javascript
复制
#detailYear {
display: none;
width: 94%;
border: 1px solid rgb(221, 221, 221);

}

代码语言:javascript
复制
#detailYear td {
    vertical-align: middle;
    text-align: center;
    border-bottom: 0px solid rgb(221, 221, 221);
    border-top: 1px solid rgb(221, 221, 221);
    border-right: 1px solid rgb(221, 221, 221);
    border-left: 1px solid rgb(221, 221, 221);
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-01-09 19:09:09

​

代码语言:javascript
复制
You should try using div for this kind of things that would be easy.      - Simply create two div.       - one on the left side with text vertical.      - then create a table or div whichever you need.      - then again create a div at the bottom       - then provide the css according to your need.
代码语言:javascript
复制
Example: `<div class='leftDiv'>
  <p>
  Texting
  </p>
</div>
<div class='tableContainer'>
<table>
<tr><td>test</td><td>one</td></tr>
<tr><td>test</td><td>one</td></tr>
<tr><td>test</td><td>one</td></tr>
<tr><td>test</td><td>one</td></tr>
<tr><td>test</td><td>one</td></tr>
</table>
</div>
<div style='clear:both'>

</div>
<div class='mask'>

</div>
<div class='bottomDiv'>
<p>
  Texting
  </p>
</div>`

CSS `.container{
  height: 100%;
  width: 100%;
}
.tableContainer{
  float: left;
  clear: right;
}
.leftDiv{
  width:50px; 
  height:300px; 
  background:lightgray; 
  position:relative;
  border: 1px solid;
  border-bottom: 0;
  float: left;
}
.leftDiv p{
  text-align: center;
}
.mask{
  width:50px; 
  height:51px; 
  background:lightgray; 
  position:relative;
  border: 1px solid;
  border-top: 0;
  border-right: 0px;
  float: left;

}
.bottomDiv {
  width:500px; 
  height:50px; 
  background:lightgray; 
  position:relative; 
  float:left;
  border: 1px solid;
  border-left: 0px;
}
.bottomDiv p{
  text-align: center;
}`
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48165802

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档