Skip to content

Instantly share code, notes, and snippets.

@kenny-evitt
Last active May 9, 2016 17:18
Show Gist options
  • Save kenny-evitt/762d59e91bfee57ade70 to your computer and use it in GitHub Desktop.
Save kenny-evitt/762d59e91bfee57ade70 to your computer and use it in GitHub Desktop.
Simple in-line-styled HTML table
<!-- Styles adapted from http://purecss.io/tables/ -->
<table style="border-collapse: collapse; border-spacing: 0; empty-cells: show; border: 1px solid #cbcbcb; line-height: 1.5;">
<thead style="background: #e0e0e0; color: #000; text-align: left; vertical-align: bottom;">
<tr>
<th style="border-left: 1px solid #cbcbcb; border-width: 0 0 0 1px; font-size: inherit; margin: 0; overflow: visible; border-left-width: 0;">
Data value
</th>
<th style="border-left: 1px solid #cbcbcb; border-width: 0 0 0 1px; font-size: inherit; margin: 0; overflow: visible; border-left-width: 0;">
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border-left: 1px solid #cbcbcb; border-width: 0 0 0 1px; font-size: inherit; margin: 0; overflow: visible; border-left-width: 0;">
1
</td>
<td style="border-left: 1px solid #cbcbcb; border-width: 0 0 0 1px; font-size: inherit; margin: 0; overflow: visible; border-left-width: 0;">
Integer
</td>
</tr>
<tr>
<td style="border-left: 1px solid #cbcbcb; border-width: 0 0 0 1px; font-size: inherit; margin: 0; overflow: visible; border-left-width: 0;">
2
</td>
<td style="border-left: 1px solid #cbcbcb; border-width: 0 0 0 1px; font-size: inherit; margin: 0; overflow: visible; border-left-width: 0;">
Currency
</td>
</tr>
<tr>
<td style="border-left: 1px solid #cbcbcb; border-width: 0 0 0 1px; font-size: inherit; margin: 0; overflow: visible; border-left-width: 0;">
3
</td>
<td style="border-left: 1px solid #cbcbcb; border-width: 0 0 0 1px; font-size: inherit; margin: 0; overflow: visible; border-left-width: 0;">
Date
</td>
</tr>
</tbody>
</table>
@kenny-evitt
Copy link
Author

Adding padding to the cells is nicer:

...
    padding: 0 1em 0 1em;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment