Skip to content

Instantly share code, notes, and snippets.

@croraf
Created October 9, 2019 10:02
Show Gist options
  • Save croraf/7dbfdf88288eb1024285b6e719bd1572 to your computer and use it in GitHub Desktop.
Save croraf/7dbfdf88288eb1024285b6e719bd1572 to your computer and use it in GitHub Desktop.
Compare tables
<Table className={classes.table}>
<TableHead>
<TableRow>
<TableCell>Dessert (100g serving)</TableCell>
<TableCell align="right">Calories</TableCell>
<TableCell align="right">Fat&nbsp;(g)</TableCell>
<TableCell align="right">Carbs&nbsp;(g)</TableCell>
<TableCell align="right">Protein&nbsp;(g)</TableCell>
</TableRow>
</TableHead>
<TableBody>
{rows.map(row => (
<TableRow key={row.name}>
<TableCell component="th" scope="row">
{row.name}
</TableCell>
<TableCell align="right">{row.calories}</TableCell>
<TableCell align="right">{row.fat}</TableCell>
<TableCell align="right">{row.carbs}</TableCell>
<TableCell align="right">{row.protein}</TableCell>
</TableRow>
))}
</TableBody>
</Table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment