Color tables is a user macro that makes your table awesome for you. It applies colors and styles to basic confluence table and make it shiny.
Key features
## Developed by: Alana Fernando
## Shared with love
## @param style:title=style type|type=enum|required=true|desc=Choose a style.|enumValues=Style1,Style2,Style3,Style4,Style5
## @param alignment:title=Text alignment|type=enum|desc=Choose Text alignment.|enumValues=Right,Left,Center
## @param fontfamily:title=Font family|type=enum|desc=Choose font family. (some font families may not compatible with browsers)|enumValues=Times New Roman,Arial,Courier New,Tahoma,Trebuchet MS,Open Sans
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
#if ($paramstyle == "Style1")
<style>
.styletableth1 table.confluenceTable th.confluenceTh {
color:white;
text-align: $paramalignment;
background: #0288D1;
border:white 4px solid;
outline: 1px solid #f2f2f2;
}
.styletableheaderfont1 th div.tablesorter-header-inner{
color:white;
text-align: $paramalignment;
}
.styletableeven1 tr:nth-child(odd){
color:black;
background:#E0E0E0;
border:#1976D2 2px solid;
}
.styletableodd1 tr:nth-child(even){
color:black;
background: #FAFAFA;
border:#1976D2 2px solid;
}
.styletable1 td{
text-align: $paramalignment;
border:white 4px solid;
outline: 1px solid #f2f2f2;
}
</style>
<div class="styletable1 styletableth1 styletableeven1 styletableodd1 styletableheaderfont1 " style="font-family:$paramfontfamily;">$body</div>
#elseif ($paramstyle == "Style2")
<style>
.styletableth2 table.confluenceTable th.confluenceTh {
color:#fff2df;
text-align: $paramalignment;
background: #ff9e22;
border:white 4px solid;
outline: 1px solid #f2f2f2;
}
.styletableheaderfont2 th div.tablesorter-header-inner{
color:#fff2df;
}
.styletableeven2 tr:nth-child(odd){
color:black;
background:#ffc77d;
border:white 2px solid;
}
.styletableodd2 tr:nth-child(even){
color:black;
background: #ffddb0;
border:white 2px solid;
}
.styletable2 td{
border: white 4px solid;
outline: 1px solid #f2f2f2;
text-align: $paramalignment;
}
</style>
<div class="styletable2 styletableth2 styletableeven2 styletableodd2 styletableheaderfont2 " style="font-family:$paramfontfamily;">$body</div>
#elseif ($paramstyle == "Style3")
<style>
.styletableth3 table.confluenceTable th.confluenceTh {
color:#F9FBE7;
text-align: $paramalignment;
background:#AFB42B;
border:white 4px solid;
outline: 1px solid #f2f2f2;
}
.styletableheaderfont3 th div.tablesorter-header-inner{
color:#F9FBE7;
}
.styletableeven3 tr:nth-child(odd){
color:black;
background:#D4E157;
border:white 2px solid;
}
.styletableodd3 tr:nth-child(even){
color:black;
background: #F0F4C3;
border:white 2px solid;
}
.styletable3 td{
border: white 4px solid;
text-align: $paramalignment;
outline: 1px solid #f2f2f2;
}
</style>
<div class="styletable3 styletableth3 styletableeven3 styletableodd3 styletableheaderfont3 " style="font-family:$paramfontfamily;">$body</div>
#elseif ($paramstyle == "Style4")
<style>
.styletableth4 table.confluenceTable th.confluenceTh {
color:#33691E;
text-align: $paramalignment;
background: #7CB342;
border:white 4px solid;
outline: 1px solid #f2f2f2;
}
.styletableheaderfont4 th div.tablesorter-header-inner{
color:#33691E;
}
.styletableeven4 tr:nth-child(odd){
color:black;
background:#EEEEEE;
border:white 2px solid;
}
.styletableodd4 tr:nth-child(even){
color:black;
background: #FAFAFA;
border:white 2px solid;
}
.styletable4 td{
border: white 4px solid;
text-align: $paramalignment;
outline: 1px solid #f2f2f2;
}
</style>
<div class="styletable4 styletableth4 styletableeven4 styletableodd4 styletableheaderfont4 " style="font-family:$paramfontfamily;">$body</div>
#elseif ($paramstyle == "Style5")
<style>
.styletableth5 table.confluenceTable th.confluenceTh {
color:#EFEBE9;
text-align: $paramalignment;
background: #BF360C;
border:white 4px solid;
outline: 1px solid #f2f2f2;
}
.styletableheaderfont5 th div.tablesorter-header-inner{
color:#EFEBE9;
}
.styletableeven5 tr:nth-child(odd){
color:black;
background:#D7CCC8;
border:white 2px solid;
}
.styletableodd5 tr:nth-child(even){ ;
color:black;
background: #EFEBE9;
border:white 2px solid;
}
.styletable5 td{
border: white 4px solid;
text-align: $paramalignment;
outline: 1px solid #f2f2f2;
}
</style>
<div class="styletable5 styletableth5 styletableeven5 styletableodd5 styletableheaderfont5 " style="font-family:$paramfontfamily;">$body</div>
#else
<div>$body</div>
#end
How to use
Adding user macro
Remember to select Rendered as macro body processing.
Make it grow and glow ...
You are welcome to change the styles as of your choice and cut off lengthy codes and make it efficient.
Alana Fernando
QA Analyst
MillenniumIT
Sri Lanka
34 accepted answers
38 comments