File tree Expand file tree Collapse file tree
doc/content/examples/kitchen-sink Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /* *
2+ * Tables
3+ */
4+
5+ // ensure table will fit in the article width and make them y-scrollable
6+ table {
7+ display : table ;
8+ overflow : auto ;
9+
10+ // default to table-center
11+ margin-left : auto ;
12+ margin-right : auto ;
13+
14+ & .table-right {
15+ margin-right : 0 ;
16+ }
17+
18+ & .table-left {
19+ margin-left : 0 ;
20+ }
21+ }
22+
23+ // customize table caption from bootstrap
24+ // to display them on top and centered
25+ table caption {
26+ text-align : center ;
27+ caption-side : top ;
28+ color : var (--pst-color-text-muted );
29+ }
30+
31+ // MyST Markdown tables use these classes to control alignment
32+ th ,
33+ td {
34+ & .text-align\: left {
35+ text-align : left ;
36+ }
37+
38+ & .text-align\: right {
39+ text-align : right ;
40+ }
41+
42+ & .text-align\: center {
43+ text-align : center ;
44+ }
45+ }
46+
47+ // override bootstrap table colors
48+ .table {
49+ --bs-table-bg : transparent ; // background
50+ --bs-table-color : var (
51+ --pst-color-text-base
52+ ); // ensure text and bullets are visible
53+ }
Original file line number Diff line number Diff line change 5858@import " ./content/lists" ;
5959@import " ./content/quotes" ;
6060// @import "./content/spans";
61- // @import "./content/tables";
61+ @import " ./content/tables" ;
6262@import " ./content/toctree" ;
6363// @import "./content/math";
6464
Original file line number Diff line number Diff line change 1+ ---
2+ title : Tables
3+ ---
4+
5+ ## Markdown Tables
6+
7+ The theme supports [ GFM table markdown] ( https://github.github.com/gfm/#tables-extension- ) .
8+
9+ | Syntax | Description |
10+ | --------- | ----------- |
11+ | Header | Title |
12+ | Paragraph | Text |
13+
14+ Markdown tables can be aligned:
15+
16+ | Syntax | Description | Test Text |
17+ | :-------- | :---------: | ----------: |
18+ | Header | Title | Here's this |
19+ | Paragraph | Text | And more |
20+
21+ ## Table shortcode
22+
23+ This is a feature preview and is not ready for adoption:
24+
25+ {{< yamlToTable >}}
26+ headers:
27+
28+ - Project
29+ - Available Packages
30+ - Download location
31+
32+ format:
33+
34+ - align: left
35+ - align: left
36+ - align: right
37+
38+ rows:
39+
40+ - columns:
41+
42+ - "NumPy"
43+ - |
44+ Official _ source code_ (all platforms) and _ binaries_ for<br />
45+ ** Windows** , ** Linux** , and ** Mac OS X**
46+ - "[ PyPi page for NumPy] ( https://pypi.python.org/pypi/numpy ) "
47+
48+ - columns:
49+ - SciPy
50+ - |
51+ Official _ source code_ (all platforms) and _ binaries_ for<br />
52+ ** Windows** , ** Linux** and ** Mac OS X**
53+ - |
54+ [ SciPy release page] ( https://github.com/scipy/scipy/releases ) (sources)<br />
55+ [ PyPI page for SciPy] ( https://pypi.python.org/pypi/scipy ) (all)
56+
57+ {{< /yamlToTable >}}
Original file line number Diff line number Diff line change 11{{/*
22
33{{< yamlToTable > }}
4+ caption: 'Table caption'
5+
46headers:
57 - Project
68 - Available Packages
3436
3537{{ $arg := .Get 0 }}
3638{{ $data := .Inner | transform.Unmarshal }}
39+ {{- $id := printf "id%03d" $.Ordinal -}}
3740
3841{{ with $data }}
39- < table >
42+ < table class ="table " id ="{{ $id }} ">
43+ {{- with .caption -}}
44+ < caption > < span class ="caption-text "> {{ . }}</ span > < a class ="headerlink " href ="#{{ $id }} " title ="Link to this table "> #</ a > </ caption >
45+ {{- end }}
4046 {{ range .format }}
4147 < col
4248 {{ range $key, $val : = . }}
4652 {{ end }}
4753
4854 {{ range .headers }}
49- < th > {{ . | markdownify }}</ th >
55+ < th class =" head " > {{ . | markdownify }}</ th >
5056 {{ end }}
5157
5258 {{ range $row := .rows }}
You can’t perform that action at this time.
0 commit comments