A Pen by Jesper Birkestrøm on CodePen.
Created
December 9, 2014 08:01
-
-
Save birkestroem/45dfcf6903887d11e1ed to your computer and use it in GitHub Desktop.
Damn it, man, I'm a doctor, not a torpedo technician!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table style="border: 1px solid red;"> | |
<tr> | |
<td> | |
<div class="applicationName"> | |
<h2>Tekst</h2> | |
</div> | |
</td> | |
<td> | |
2nd cell | |
</td> | |
</tr> | |
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NodeList.prototype.forEach || (NodeList.prototype.forEach = Array.prototype.forEach); | |
document.querySelectorAll('div.applicationName').forEach(function (outer) { | |
var inner = document.querySelector('h2', outer); | |
var box = inner.getBoundingClientRect(); | |
outer.style.width = box.width + 'px'; | |
outer.style.height = box.height + 'px'; | |
inner.style.transform = 'translate(0,' + (box.height) + 'px) ' + window.getComputedStyle(inner).transform; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
table { | |
height: 300px; | |
} | |
div { | |
display: inline-block; | |
//background-color: blue; | |
h2 { | |
margin: 0; | |
padding: 0; | |
display: inline-block; | |
//background-color: yellow; | |
transform: rotate(-90deg); | |
transform-origin: 0 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment