There are multiple techniques to achieve this effect:
1) Utilize HTML tags <strike>
or <del>
.
2) Implement the CSS property text-decoration: line-through;
3) Use the following CSS code:
td{
border: 1px solid black;
position: relative;
}
td:after{
content: "";
display: block;
width: 100%;
height: 1px;
background-color: black;
position: absolute;
top: 50%;
}
See it in action here
UPDATE: To address a firefox issue related to the position: relative and td element, wrap the text within a div for each td and apply the same CSS as above.
Updated example
UPDATE 2: Commenter @NicoO pointed out that the firefox bug can be fixed by adding line-height: 0
to the tr
element.
Revised demo