Skip to content

Commit 3e86fe2

Browse files
adding additional css tables example
1 parent 26a5bb2 commit 3e86fe2

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>CSS tables example rewritten as CSS grid</title>
6+
<style>
7+
html {
8+
font-family: sans-serif;
9+
}
10+
11+
form {
12+
display: grid;
13+
grid-template-columns: repeat(5, 1fr);
14+
grid-gap: 5% 10px;
15+
/*grid-column-gap: 5%;
16+
grid-row-gap: 10px;*/
17+
width: 508px;
18+
margin: 0 auto;
19+
}
20+
21+
form label {
22+
grid-column: auto / span 2;
23+
text-align: right;
24+
}
25+
26+
form input {
27+
width: 100%;
28+
grid-column: auto / span 3;
29+
}
30+
31+
form p {
32+
grid-column: auto / span 5;
33+
grid-row: 4;
34+
color: #999;
35+
font-style: italic;
36+
}
37+
</style>
38+
</head>
39+
<body>
40+
<form>
41+
<p>First of all, tell us your name and age.</p>
42+
43+
<label for="fname">First name:</label>
44+
<input type="text" id="fname">
45+
46+
47+
<label for="lname">Last name:</label>
48+
<input type="text" id="lname">
49+
50+
51+
<label for="age">Age:</label>
52+
<input type="text" id="age">
53+
54+
</form>
55+
</body>
56+
</html>

0 commit comments

Comments
 (0)