Skip to content

Instantly share code, notes, and snippets.

@shgtkshruch
Last active January 3, 2016 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shgtkshruch/8500825 to your computer and use it in GitHub Desktop.
Save shgtkshruch/8500825 to your computer and use it in GitHub Desktop.
Some tables made by yaml and slim
// YAML :main.yml
tables:
- table:
- th:
aaa
td:
- bbb
- ccc
- th:
ddd
td:
- eee
- fff
- table:
- th:
ggg
td:
- hhh
- iii
- th:
jjj
td:
- kkk
- lll
// Slim :index.slim
- data.main.tables.each do |ts|
table
- ts.table.each do |t|
tr
th = t.th
- t.td.each do |d|
td = d
// HTML :index.html
<table>
<tr>
<th>aaa</th>
<td>bbb</td>
<td>ccc</td>
</tr>
<tr>
<th>ddd</th>
<td>eee</td>
<td>fff</td>
</tr>
</table>
<table>
<tr>
<th>ggg</th>
<td>hhh</td>
<td>iii</td>
</tr>
<tr>
<th>jjj</th>
<td>kkk</td>
<td>lll</td>
</tr>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment