Created
August 22, 2013 20:20
-
-
Save cdharrison/6312281 to your computer and use it in GitHub Desktop.
A way to get generated content to appear after* a specific table row. (*Note: it actually puts it before the row proceeding the one... but whatevs.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title> | |
Test | |
</title> | |
<meta charset="utf-8" /> | |
<style> | |
table{ | |
border: 1px solid #000; | |
margin: 0 auto; | |
width: 600px; | |
} | |
table td{ | |
border: 1px solid #000; | |
} | |
table tr{ | |
content: ""; | |
display: table; | |
position: relative; | |
width: 100%; | |
zoom: 1; /* Stupid IE */ | |
} | |
/* This will display at the start of whatever row you define. If you want it to appear below row 3, :nth-of-type(4) gets it there. */ | |
table tr:nth-of-type(4):after{ | |
content: '\25B2\25B2\25B2 This is included in newsletters! \25B2\25B2\25B2'; | |
background: #000; | |
border: 1px solid #c00; | |
color: #fff; | |
display: table-caption; | |
font: normal 10px sans-serif; | |
margin: 0 auto; | |
padding: 1%; | |
bottom: 0; | |
text-align: center; | |
width: 97%; | |
} | |
</style> | |
</head> | |
<body> | |
<table> | |
<tr> | |
<td><img src="http://placehold.it/350x150" /></td> | |
<td>Text Goes Here</td> | |
</tr> | |
<tr> | |
<td><img src="http://placehold.it/350x150" /></td> | |
<td>Text Goes Here</td> | |
</tr> | |
<tr> | |
<td><img src="http://placehold.it/350x150" /></td> | |
<td>Text Goes Here</td> | |
</tr> | |
<tr> | |
<td><img src="http://placehold.it/350x150" /></td> | |
<td>Text Goes Here</td> | |
</tr> | |
<tr> | |
<td><img src="http://placehold.it/350x150" /></td> | |
<td>Text Goes Here</td> | |
</tr> | |
<tr> | |
<td><img src="http://placehold.it/350x150" /></td> | |
<td>Text Goes Here</td> | |
</tr> | |
</table> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Le demo: http://cdharrison.com/sandbox/css/table-generated-content/