Last active
December 25, 2015 16:09
-
-
Save rubo77/7003745 to your computer and use it in GitHub Desktop.
adding up- and downarrows in table headers with CSS :after
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 { | |
border-collapse: collapse; | |
border-spacing: 0; | |
} | |
table th.header { | |
background-color: #F3F781; | |
padding-right: 0px; | |
cursor:pointer; | |
} | |
table th.header:after { | |
content: "\0000a0\0000a0"; | |
} | |
table th.headerSortUp, table th.headerSortDown { | |
background-color: lightblue; | |
} | |
table th.headerSortUp:after { | |
content: "\0000a0\2912"; | |
color:blue; | |
} | |
table th.headerSortDown:after { | |
content: "\0000a0\2913"; | |
color:blue; | |
} | |
table td, table th { | |
border: 1pt solid #333; | |
padding: 0.25em 0.5em; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I added two encoded space characters on the right as default and if it is clicked it changes into the arrows with a preceding space.
used it here: http://stackoverflow.com/questions/19386871/obfuscate-emails-with-ruby-to-protect-against-harvesters
and here: ffnord/ffmap-d3#35