Vue
by PhilQ
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
<div id="app">
<nav class="navbar navbar-light bg-light">
</nav>
</div>
<table>
<tr>
<td colspan="4">Category 1</td>
</tr>
<tr class="vertical">
<td><span>Some attribute 1</span></td>
<td><span>Some 2</span></td>
<td><span>Some attribute 3</span></td>
<td><span>Some attrie 4</span></td>
</tr>
</table>
<br /><br/><br /><br/><br /><br/>
<div class="row">
<div class="cell">
<div class="vertical"><span>Content rot</span></div>
</div>
<div class="cell">
<div class="vertical"><span>Content that is rotated</span></div>
</div>
<div class="cell">
<div class="vertical"><span>Content that rotated</span></div>
</div>
</div>
SCSS
*,*::before,*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: #eee;
padding: 20px;
font-family: sans-serif;
}
#app {
width: 100%;
}
table {
border-spacing: none;
border-collapse: collapse;
}
td {
border: 1px solid #000;
}
tr.vertical {
//
td {
width: 20px;
height: auto;
overflow: hidden;
span {
//margin-top: 100%;
display: block;
transform-origin: 0% 0%;
transform: rotate(-90deg) translate(-100%, -0%);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
.row {
position: relative;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-content: stretch;
align-items: flex-end;
background: blue;
}
.cell {
flex: 1 1 20px;
overflow: hidden;
position: relative;
display: table;
border-spacing: 0px;
background: green;
}
div.vertical {
padding: 100% 0 0;
height: 0;
border: 1px solid red;
}
div.vertical span {
height: 20px;
display: block;
background-color: rgba(#f00, 0.3);
transform-origin: 0% 0%;
transform: rotate(-90deg) translate(-0%, -0%);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Vue
new Vue({
el: "#app",
data: {
categories: [],
templates: {
category: {
id: '',
name: '',
values: [],
},
value: {
id: '',
name: '',
},
},
forms: {
categories: 3,
values: 3,
},
},
methods: {
}
})