Created
January 10, 2017 10:13
-
-
Save rastislavcore/8814922f7ef5a0fa80905cf1c6e99a05 to your computer and use it in GitHub Desktop.
Transform horizontal to vertical 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
table { | |
display:block; | |
padding: 0px; | |
border-collapse:collapse; | |
border-spacing:0; | |
margin-top: 0px; | |
margin-right: auto; | |
margin-bottom: 0px; | |
margin-left: auto; | |
} | |
thead { | |
display: block; | |
float: left; | |
margin: 0px; | |
padding: 0px; | |
width: 100px; | |
} | |
tbody { | |
margin: 0px; | |
padding: 0px; | |
} | |
tbody tr { | |
float:left; | |
} | |
th, td { | |
display:block; | |
padding: 5px; | |
margin: 0px; | |
} | |
thead > tr th:nth-child(odd) { | |
display:block; | |
float:left; | |
} | |
thead > tr th:nth-child(even) { | |
display:block; | |
float:left; | |
} | |
tbody > tr td:nth-child(odd) { | |
display:block; | |
} | |
tbody > tr td:nth-child(even) { | |
display:block; | |
float:right; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment