Last active
October 16, 2019 21:02
-
-
Save akopcz2/acace37209c17b67a843f356a7995fdb to your computer and use it in GitHub Desktop.
looping tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Fragment> | |
{data.tables.map((table, i) => { | |
return <section key={i} className="ourTable"> | |
<table> | |
<caption>{table.title}</caption> | |
<tbody> | |
{table.rows.map((row, i) => { | |
return <tr className={`col-${i + 1}`} key={i}> | |
{row.cols.map((col, i) => { | |
return <td className={`col-${i + 1}`} key={i}>{col.value}</td> | |
})} | |
</tr> | |
})} | |
</tbody> | |
</table> | |
</section> | |
})} | |
</Fragment> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment