Skip to content

Instantly share code, notes, and snippets.

@gunnarbittersmann
Last active July 26, 2016 20:59
Show Gist options
  • Save gunnarbittersmann/449c8bb5ee8423042c964f1e0ba217f0 to your computer and use it in GitHub Desktop.
Save gunnarbittersmann/449c8bb5ee8423042c964f1e0ba217f0 to your computer and use it in GitHub Desktop.
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
* https://forum.selfhtml.org/self/2016/jul/26/table-width-margin-usw/1672000#m1672000
*/
body{
background:#333;
}
.kalender{
margin: auto;
border-collapse:collapse;
border: solid white;
border-width: 0 2em 1em;
background:blue;
text-align:center;
}
.kalender caption{
background:white;
padding:1em;
}
.kalender tr{
padding:1em;
}
.kalender th, .kalender td{
width:4em;
height:4em;
border:1px solid #ccc;
}
<!-- content to be placed inside <body>…</body> -->
<table class="kalender">
<caption>Juli 2016</caption>
<thead>
<tr>
<th>KW</th><th>Mo</th><th>Di</th><th>Mi</th><th>Do</th><th>Fr</th><th>Sa</th><th>So</th>
</tr>
</thead>
<tbody>
<tr><th>26</th><td>27</td><td>28</td><td>29</td><td>30</td><td>1</td><td>2</td><td>3</td></tr>
<tr><th>27</th><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td></tr>
<tr><th>28</th><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td></tr>
<tr><th>29</th><td>18</td><td>19</td><td>20</td><td>21</td><td>22</td><td>23</td><td>24</td></tr>
<tr><th>30</th><td>25</td><td>26</td><td>27</td><td>28</td><td>29</td><td>30</td><td>31</td></tr>
</tbody>
</table>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment