css - 自动展开旋转列 CSS
问题描述
当有更多文本时,我正在尝试自动扩展旋转的列。
我尝试了各种 css,例如删除 tranform-origin 或使用 translateX(-50%) translateY(-50%) rotate(-90deg); 选项。
我想知道我是否遗漏了什么?
下面的代码示例是我正在处理的。
.tcentre {
text-align: center;
}
/*Events Matrix*/
.matrix table,
.matrix td,
.matrix th {
border-spacing: 0;
border: 1px solid;
text-align: left
}
.matrix .vert>th:nth-child(1n+3) {
position: relative;
height: 150px;
min-width: 40px;
padding: 4px;
}
.matrix .vert>th {
overflow: hidden;
}
.matrix .vert>th>div>div {
height: 100%;
line-height: 18px;
width: 150px;
position: absolute;
bottom: -145px;
/*border: 1px solid blue; */
transform: rotate(-90deg);
transform-origin: top left;
}
.matrix .tbottom {
vertical-align: bottom !important;
text-align: left !important;
}
<DIV id="content" class="matrix">
<table>
<thead>
<tr class="vert">
<th class="tbottom" style="Width: 100px;">Part</th>
<th class="tbottom" style="Width: 100px;">Name</th>
<th style="Width: 20px;">
<div>
<div>Park<br>2018-08-12</div>
</div>
</th>
<th style="Width: 20px;">
<div>
<div>War Memorial Lots more text in this cell<br>2018-08-19</div>
</div>
</th>
<th style="Width: 20px;">
<div>
<div>Charity Collection<br>2018-10-13</div>
</div>
</th>
<th style="Width: 20px;">
<div>
<div>Concert<br>2018-10-28</div>
</div>
</th>
<th style="Width: 20px;">
<div>
<div>Remembrance<br>2018-11-10</div>
</div>
</th>
</tr>
<tr>
<td class="nowrap">Score</td>
<td class="nowrap">Person 1</td>
<td class="tcentre colour-Y">Y</td>
<td class="tcentre colour-Y">Y</td>
<td class="tcentre colour-Y">Y</td>
<td class="tcentre colour-Y">Y</td>
<td class="tcentre colour-Y">Y</td>
</tr>
<tr>
<td class="nowrap">Solo Cornet</td>
<td class="nowrap">Person 2</td>
<td class="tcentre colour-Y">Y</td>
<td class="tcentre colour-" />
<td class="tcentre colour-" />
<td class="tcentre colour-" />
<td class="tcentre colour-" />
</tr>
</thead>
</table>
</Div>
解决方案
推荐阅读
- java - Liquibase 前置条件 MARK_RAN,回滚执行
- sql - 使用关系模型的objections.js 性能非常慢
- sql - SQL-删除具有特定时间段的行
- python - Culebra 坚持“接触点(单位=DIP)”
- javascript - regexp 获取路径名,即使您不知道其中的某些部分
- angular - 如何使用 jest js 在 Angular 中创建 SpyObj?
- python - 使用 np.einsum 将两个数组相乘和相加
- javascript - Vanillla Javascript 使用数据类型显示隐藏内容
- python-3.x - 如何检测硒初始化程序驱动程序是否无头
- python - Python 套接字客户端没有收到任何东西,由 recv.from(datasize) 挂起