如何在tabulator js库中自动生成列的垂直列标题?
我这样做了,它运作得很好:
//define data
var tabledata = {!!$one!!}
//define table
var table = new Tabulator("#table-1", {
data:tabledata,
autoColumns:true,
layout:"fitColumns",
});
但是,当我添加“headerVertical:true”时,它不会做任何更改:
//define data
var tabledata = {!!$one!!}
//define table
var table = new Tabulator("#table-1", {
data:tabledata,
autoColumns:true,
headerVertical:true,
layout:"fitColumns",
});
当列自动生成时,任何人都可以帮我制作垂直列标题吗?
headerVertical仅在按照documentation定义列时才有效,如何使用简单的css来实现https://jsfiddle.net/dota2pro/t0gw9jbp/5/
旋转180度使用CSS rotate
.tabulator-col-title {
-webkit-writing-mode: vertical-rl;
-ms-writing-mode: tb-rl;
writing-mode: vertical-rl;
text-orientation: mixed;
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: center;
justify-content: center;
padding-top: 20px;
/* if you use rotate change this to paddig-bottom*/
transform: rotate(180deg);
/* incase of rotation*/
}