Skip to content

Commit

Permalink
Merge pull request #288 from Mogztter/issue-29-table-styles
Browse files Browse the repository at this point in the history
resolves #29 add table styles
  • Loading branch information
obilodeau authored Dec 10, 2019
2 parents 4bd85df + 064b7bf commit 2a0035d
Show file tree
Hide file tree
Showing 3 changed files with 429 additions and 0 deletions.
141 changes: 141 additions & 0 deletions examples/tables-styles.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
= Table styles

== Default table with header

[cols=2*,options=header]
|===
| Header 1
| Header 2

| Row 1, Col1
| Row 1, Col2

| Row 2, Col1
| Row 2, Col2

|===

== Frames

=== Frame none

[cols=2*,frame=none,options=header]
|===
| Header 1
| Header 2

| Row 1, Col1
| Row 1, Col2

| Row 2, Col1
| Row 2, Col2

|===

=== Frame sides

[cols=2*,frame=sides,options=header]
|===
| Header 1
| Header 2

| Row 1, Col1
| Row 1, Col2

| Row 2, Col1
| Row 2, Col2

|===

=== Frame topbot

[cols=2*,frame=topbot,options=header]
|===
| Header 1
| Header 2

| Row 1, Col1
| Row 1, Col2

| Row 2, Col1
| Row 2, Col2

|===

== Grid

=== Grid none

[cols=2*,grid=none,options=header]
|===
| Header 1
| Header 2

| Row 1, Col1
| Row 1, Col2

| Row 2, Col1
| Row 2, Col2

|===

=== Grid cols

[cols=2*,grid=cols,options=header]
|===
| Header 1
| Header 2

| Row 1, Col1
| Row 1, Col2

| Row 2, Col1
| Row 2, Col2

|===

=== Grid rows

[cols=2*,grid=rows,options=header]
|===
| Header 1
| Header 2

| Row 1, Col1
| Row 1, Col2

| Row 2, Col1
| Row 2, Col2

|===

== Combo

=== Grid none, frame none

[cols=2*,grid=none,frame=none,options=header]
|===
| Header 1
| Header 2

| Row 1, Col1
| Row 1, Col2

| Row 2, Col1
| Row 2, Col2

|===

== Alignments

[cols="^,<,>", options="header"]
|===

| Name
| Description
| Version

| Asciidoctor
| Awesome way to write documentation
| 2.0.4
|===
32 changes: 32 additions & 0 deletions templates/asciidoctor_revealjs.css.slim
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,38 @@ css:
max-height: 100%;
}

/* tables */
table{border-collapse:collapse;border-spacing:0}
table{margin-bottom:1.25em;border:solid 1px #dedede}
table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;text-align:left}
table tr th,table tr td{padding:.5625em .625em;font-size:inherit}
table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{display:table-cell;line-height:1.6}
td.tableblock>.content{margin-bottom:1.25em}
td.tableblock>.content>:last-child{margin-bottom:-1.25em}
table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
table.grid-all>thead>tr>.tableblock,table.grid-all>tbody>tr>.tableblock{border-width:0 1px 1px 0}
table.grid-all>tfoot>tr>.tableblock{border-width:1px 1px 0 0}
table.grid-cols>*>tr>.tableblock{border-width:0 1px 0 0}
table.grid-rows>thead>tr>.tableblock,table.grid-rows>tbody>tr>.tableblock{border-width:0 0 1px}
table.grid-rows>tfoot>tr>.tableblock{border-width:1px 0 0}
table.grid-all>*>tr>.tableblock:last-child,table.grid-cols>*>tr>.tableblock:last-child{border-right-width:0}
table.grid-all>tbody>tr:last-child>.tableblock,table.grid-all>thead:last-child>tr>.tableblock,table.grid-rows>tbody>tr:last-child>.tableblock,table.grid-rows>thead:last-child>tr>.tableblock{border-bottom-width:0}
table.frame-all{border-width:1px}
table.frame-sides{border-width:0 1px}
table.frame-topbot,table.frame-ends{border-width:1px 0}
.reveal table th.halign-left,.reveal table td.halign-left{text-align:left}
.reveal table th.halign-right,.reveal table td.halign-right{text-align:right}
.reveal table th.halign-center,.reveal table td.halign-center{text-align:center}
.reveal table th.valign-top,.reveal table td.valign-top{vertical-align:top}
.reveal table th.valign-bottom,.reveal table td.valign-bottom{vertical-align:bottom}
.reveal table th.valign-middle,.reveal table td.valign-middle{vertical-align:middle}
table thead th,table tfoot th{font-weight:bold}
tbody tr th{display:table-cell;line-height:1.6}
tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{font-weight:bold}
thead{display:table-header-group}

.reveal table.grid-none th,.reveal table.grid-none td{border-bottom:0!important}

/* callouts */
.conum[data-value] {display:inline-block;color:#fff!important;background-color:rgba(50,150,50,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
.conum[data-value] *{color:#fff!important}
Expand Down
Loading

0 comments on commit 2a0035d

Please sign in to comment.