Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html CSS旋转/倾斜表格标题边框对齐_Html_Css - Fatal编程技术网

Html CSS旋转/倾斜表格标题边框对齐

Html CSS旋转/倾斜表格标题边框对齐,html,css,Html,Css,我需要制作倾斜/旋转的表格标题,如何使倾斜的内侧标题边框与表格单元格元素的垂直边框对齐 HTML: 将标题稍微移动一点,如 th.rotate > div { transform: /* Magic Numbers */ translate(-18px, 51px) /* 45 is really 360 - 45 */ rotate(315deg); width: 30px; } 看看这个

我需要制作倾斜/旋转的表格标题,如何使倾斜的内侧标题边框与表格单元格元素的垂直边框对齐

HTML:


将标题稍微移动一点,如

th.rotate > div {
      transform: 
        /* Magic Numbers */
        translate(-18px, 51px)
        /* 45 is really 360 - 45 */
        rotate(315deg);
      width: 30px;
    }
看看这个:

以下是我所做的:

1.删除了
th的高度

th.rotate {
    /* Something you can count on */
    white-space: nowrap;
}
2.添加了
transform origin
属性并更改了
translate

th.rotate > div {
  transform: 
    translate(-7px, -2px)
    /* 45 is really 360 - 45 */
    rotate(315deg);
    transform-origin: left bottom;
    width: 30px;
}
选中此项:
th.rotate {
    /* Something you can count on */
    white-space: nowrap;
}
th.rotate > div {
  transform: 
    translate(-7px, -2px)
    /* 45 is really 360 - 45 */
    rotate(315deg);
    transform-origin: left bottom;
    width: 30px;
}