-
Notifications
You must be signed in to change notification settings - Fork 14
/
table-layout-automatic.html
executable file
·60 lines (57 loc) · 1.56 KB
/
table-layout-automatic.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Automatic table layout</title>
<link rel="stylesheet" type="text/css" href="c/baseline.css">
<style type="text/css">
body {width: 372px;}
table {table-layout: auto; width: auto;
border-collapse: collapse;}
td {border: 1px solid; padding: 0;}
col#c3 {width: 25%;}
#r1c2 {width: 40%;}
#r2c2 {width: 50px;}
#r2c3 {width: 35px;}
#r4c1 {width: 100px;}
#r4c4 {width: 1px;}
#labels {display: grid; padding: 0; margin: 0 0 0.3em; width: auto;
grid-template-columns: 101px 140.5px 88px 22px;
}
#labels li {list-style-type: none; padding: 0; margin: 0 -1px 0 0;
border: 1px solid red; border-width: 0 1px; color: red;
text-align: center; font: italic small sans-serif; padding: 0.2em 0 0.3em;}
#labels li i {display: inline-block; transform: rotate(-90deg) translateX(0); width: 21px;}
</style>
</head>
<body>
<ol id="labels">
<li>100px</li>
<li>141px</li>
<li>88px</li>
<li><i>22px</i></li>
</ol>
<table>
<colgroup>
<col id="c1"><col id="c2"><col id="c3"><col id="c4">
</colgroup>
<tr>
<td id="r1c1">1-1</td><td id="r1c2">1-2</td>
<td id="r1c3">1-3</td><td id="r1c4">1-4</td>
</tr>
<tr>
<td id="r2c1">2-1</td><td id="r2c2">2-2</td>
<td id="r2c3">2-3</td><td id="r2c4">2-4</td>
</tr>
<tr>
<td id="r3c1">3-1</td><td id="r3c2">3-2</td>
<td id="r3c3">3-3</td><td id="r3c4">3-4</td>
</tr>
<tr>
<td id="r4c1">4-1</td><td id="r4c2">4-2</td>
<td id="r4c3">4-3</td><td id="r4c4">4-4</td>
</tr>
</table>
</body>
</html>