I'm trying to add checklist symbols to the left edge of table cells. So far, this does work. When I'm trying to stack another char on top of the checklist symbol though, things get ugly. I have found several ways to achieve the result I'm after, but none of them looks particularly good to me. Does anyone have a better idea, preferably one that'd allow to concentrate on the semantics?
.checklist::before {
content: "◯ ";
}
.checklistabs::before {
content: "◯ ";
position: absolute;
}
.check::before {
content: " ✘";
position: absolute;
font-size: 130%
}
.checked {
position: absolute;
font-size: 130%
}
.checklisttext {
margin-left: 1.5em;
}
<table>
<tr>
<td class="checklist">
perfect as long as nothing needs to be overlaid
</td>
</tr>
<tr>
<td>
<b class="checked">✘</b>
◯ Seems to work best, but has explicit bullet symbol as part of the text.
</td>
</tr>
<tr>
<td>
<div class="checklistabs" />
<div class="check" /> If the bullet symbol goes into another absolutely positioned item, we need to make space at the beginning of the text. ::before would have been much more elegant.
</td>
</tr>
<tr>
<td class="checklist">
<div class="check" /> why does this introduce a linebreak?
</td>
</tr>
<tr>
<td class="checklistabs">
<div class="check" /> Saving on divs
</td>
</tr>
<tr>
<td>
<div class="checklistabs" />
<div class="check" />
<div class="checklisttext">So this works...</div>
</td>
</tr>
<tr>
<td class="checklist check">
Looks preferrable from a semantic point of view but does not work - see http://stackoverflow.com/questions/11998593/can-i-have-multiple-before-pseudo-elements-for-the-same-element
</td>
</tr>
</table>