That’s it Paul! I tweaked just slightly in places so the look balances. The only question I had was inserting the nth-child striping. I should have known it was having none of this:
table tr:nth-child(odd){background-color: #FFFFCC}
table tr:nth-child(even){background-color: WHITE}
Here is the code in its entirety. Just get me in the saddle and I’ll produce a touch of Latin (or the Bard? Decisions Decisions . . .
I didn’t forget about you Dave. I’m doing yours next!
<!DOCTYPE html>
<HTML LANG="en">
<HEAD>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Crete+Round:ital@0;1&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Henny+Penny&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Metal+Mania&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,700;0,900;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<TITLE>98 GRID ᰄ “Tables-B-Gone” by Paul O’Brien</TITLE>
<style>
/*lower case for selectors please */
html,
body {
margin: 0;
padding: 0;
}
p {
margin: 0 0 1rem;
}
body {
margin: 5% 2.5rem;
font-size: 1rem;
line-height: 1;
font-weight: 500;
font-family: "Roboto Slab", sans-serif;
}
.container {
display: grid;
margin: 0 auto;
grid-template-columns: 1fr 1fr;
grid-template-rows: auto;
grid-template-areas:
"header1 header2"
"cou cre"
"cou hen"
"cou met";
border-bottom: 6px solid black;
}
table tr:nth-child(odd){background-color: #FFFFCC}
table tr:nth-child(even){background-color: WHITE}
.col1header,
.col2header {
margin: 0;
background: black;
color: #fff;
font-size: 1rem;
padding: 8px;
text-align: center;
line-height: 1;
font-weight: 600;
font-family: "Roboto Slab", sans-serif;
border: 6px groove #00FFFF;;
border-top-color: #00FFFF;
border-left-color: #00FFFF;
}
.col1header {
grid-area: header1;
border-right: none;
display: flex;
flex-direction: column;
justify-content: flex-end;
}
.col2header {
grid-area: header2;
border-left: none;
}
.cou {
grid-area: cou;
background-color: white;
line-height: 1;
font-weight: 700;
font-size: 1rem;
font-family: "COURIER PRIME", monospace;
}
.cre {
grid-area: cre;
background-color: white;
font-style: italic;
line-height: 1.1;
font-weight: 400;
font-size: 1rem;
font-family: "CRETE ROUND", serif;
}
.hen {
grid-area: hen;
background-color: white;
line-height: 1.5;
font-weight: 400;
font-size: 1rem;
font-family: "HENNY PENNY";
}
.met {
grid-area: met;
background-color: white;
line-height: 1;
font-weight: 400;
font-size: 1rem;
font-family: "METAL MANIA";
}
.cou,
.cre,
.hen,
.met {
padding: 6px;
}
.cou {
border-left: 6px solid black;
border-right: 1px solid black;
}
.cre,
.hen,
.met {
border-left: 1px solid black;
border-right: 6px solid black;
border-bottom: 2px solid black;
}
.met {
border-bottom: none;
}
.font-name {
text-transform: uppercase; /* Let css handle presentation not the mark up*/
}
</style>
</head>
<body>
<div class="container">
<h2 class="col1header">Header for the left Column</h2>
<div class="cou">
<p>This is a sample of the (bolded) Google Font <span class="font-name">“Courier Prime”</span> – a Monospace font developed by Mozilla!</p>
<p>More stuff here</p>
</div>
<!-- not happy with 2 h1s so this should probably be h2 -->
<h2 class="col2header">Header for the right Column with more text to wrap</h2>
<div class="cre">
<p>This is a sample of the Google Font <b class="font-name">“Crete Round”</b> – shown here italicized</p>
<p>More stuff here</p>
</div>
<div class="hen">
<p>This is a sample of the Google Font <span class="font-name">“HENNY PENNY”</span> – <b>a playful display font</b> by font developer “brownfox”</p>
<p>More stuff here</p>
</div>
<div class="met">
<p>This is a sample of the Google Font ,span class="font-name"“MetalL Mania”</span> – a Gothic font rendered in small caps, particularly suited to <b>SHAKESPEARE EXCERPTS</b> I have found.</p>
<p>More stuff here</p>
</div>
</div>
</body>
</html>