我的细胞之间有边距

时间:2014-12-30 16:44:36

标签: html css

我有几个单元格的表格,我想在单元格<td>

之间留出空格

JSFIDDLE

.line {
    border-bottom:1px solid black;
}

.textRotation {
    -webkit-transform: rotate(-90deg);
    -moz-transform: rotate(-90deg);
    -ms-transform: rotate(-90deg);
    -o-transform: rotate(-90deg);
    transform: rotate(-90deg);
    border-right: 1px solid black;
}

tr:nth-of-type(n+4) th
{
    padding-left:3px;
}

.border
{
    border: 1px solid black; /* crée une bordure de 1 px noir */
}

我会得到相同的结果 enter image description here

我使用@ jmore009的解决方案更新了我的代码,但我有一个新的pb

我在我的连续线上有空间

enter image description here

2 个答案:

答案 0 :(得分:4)

使用:

table{
  border-collapse: separate;
  border-spacing: 5px; //change to what you want
}

FIDDLE

答案 1 :(得分:1)

我根据你的小提琴进行了一些改动,将旋转文本包裹在<span>中:

<th class="textRotation head"  id="go" rowspan="8">Aller</th>
<style>
.textRotation {
    transform: rotate(-90deg);
    border-top: 1px solid black;
}
</style>

<th class="textRotation head"  id="go" rowspan="8"><span>Aller</span></th>
<style>
.textRotation {
    border-right: 1px solid black;
}
.textRotation span {
    transform: rotate(-90deg);
    display: inline-block;   
}
</style>

Fiddle

相关问题