Skip to content

Commit fc2b2d8

Browse files
committedSep 29, 2013
Added table support.
1 parent 638ae9e commit fc2b2d8

File tree

3 files changed

+104
-7
lines changed

3 files changed

+104
-7
lines changed
 

‎examples/examples.md

+10
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ Flatdoc examples
1313
### Backbone Patterns
1414
[View example >](examples/patterns.html)
1515

16+
Random table
17+
==============
18+
header|header|header
19+
------|------|------
20+
cell |cell |cell
21+
cell |cell |cell
22+
cell |cell |cell
23+
cell |cell |cell
24+
cell |cell |cell
25+
cell |cell |cell
1626
Pointless text
1727
==============
1828

‎theme-white/style.css

+48-7
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,43 @@ a:hover {
219219
.content blockquote :last-child {
220220
padding-bottom: 0;
221221
}
222+
.content table {
223+
margin-top: 10px;
224+
margin-bottom: 10px;
225+
padding: 0;
226+
border-collapse: collapse;
227+
clear: both;
228+
}
229+
.content table tr {
230+
border-top: 1px solid #ccc;
231+
background-color: #fff;
232+
margin: 0;
233+
padding: 0;
234+
}
235+
.content table tr :nth-child(2n) {
236+
background-color: #f8f8f8;
237+
}
238+
.content table tr th {
239+
text-align: auto;
240+
font-weight: bold;
241+
border: 1px solid #ccc;
242+
margin: 0;
243+
padding: 6px 13px;
244+
}
245+
.content table tr td {
246+
text-align: auto;
247+
border: 1px solid #ccc;
248+
margin: 0;
249+
padding: 6px 13px;
250+
}
251+
.content table tr th :first-child,
252+
.content table tr td :first-child {
253+
margin-top: 0;
254+
}
255+
.content table tr th :last-child,
256+
.content table tr td :last-child {
257+
margin-bottom: 0;
258+
}
222259
/* ----------------------------------------------------------------------------
223260
* Content
224261
*/
@@ -286,12 +323,11 @@ body.big-h3 .content h3 {
286323
body.big-h3 .content h3:before {
287324
display: block;
288325
content: '';
289-
background: -webkit-gradient(linear, left top, right top, color-stop(0.8, #dfe2e7), color-stop(1, rgba(223,226,231,0)));
290-
background: -webkit-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0) 100%);
291-
background: -moz-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0) 100%);
292-
background: -o-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0) 100%);
293-
background: -ms-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0) 100%);
294-
background: linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0) 100%);
326+
background: -webkit-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0));
327+
background: -moz-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0));
328+
background: -o-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0));
329+
background: -ms-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0));
330+
background: linear-gradient(to right, #dfe2e7 80%, rgba(223,226,231,0));
295331
-webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.4);
296332
box-shadow: 0 1px 0 rgba(255,255,255,0.4);
297333
height: 1px;
@@ -304,6 +340,7 @@ body.big-h3 .content h3:before {
304340
.content h1,
305341
.content h2,
306342
.content .big-heading,
343+
body.big-h3 .content h3,
307344
body.big-h3 .content h3 {
308345
padding-top: 40px;
309346
}
@@ -538,6 +575,11 @@ body.no-literate .content pre > code:hover::-webkit-scrollbar-thumb {
538575
padding-left: 0;
539576
padding-right: 0;
540577
}
578+
body:not(.no-literate) .content > table {
579+
margin-left: 40px;
580+
margin-right: 40px;
581+
max-width: 470px;
582+
}
541583
body:not(.no-literate):not(.big-h3) .content > h3 {
542584
margin-left: 40px;
543585
width: 470px;
@@ -828,4 +870,3 @@ code .comment {
828870
position: relative;
829871
z-index: 1;
830872
}
831-

‎theme-white/style.styl

+46
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,47 @@ a
148148
:last-child
149149
padding-bottom: 0
150150

151+
table
152+
153+
margin-top: $vmargin
154+
margin-bottom: $vmargin
155+
padding: 0
156+
border-collapse: collapse
157+
clear: both
158+
159+
tr
160+
border-top: 1px solid #cccccc
161+
background-color: white
162+
margin: 0
163+
padding: 0
164+
165+
:nth-child(2n)
166+
background-color: #f8f8f8
167+
168+
th
169+
text-align: auto;
170+
font-weight: bold
171+
border: 1px solid #cccccc
172+
margin: 0
173+
padding: 6px 13px
174+
175+
td
176+
text-align: auto;
177+
border: 1px solid #cccccc
178+
margin: 0
179+
padding: 6px 13px
180+
181+
th, td
182+
:first-child
183+
184+
margin-top: 0;
185+
:last-child
186+
margin-bottom: 0;
187+
188+
189+
190+
191+
151192
/* ----------------------------------------------------------------------------
152193
* Content
153194
*/
@@ -360,6 +401,11 @@ body.no-literate .content pre > code
360401
h4, h5, .small-heading, body:not(.big-h3) & h3
361402
small-heading()
362403

404+
table
405+
margin-left: $pad
406+
margin-right: $pad
407+
max-width: $content-width - $pad*2
408+
363409
body:not(.no-literate):not(.big-h3)
364410
.content > h3
365411
small-heading()

0 commit comments

Comments
 (0)
Please sign in to comment.