The idea is, in a table, inside a td put a line in the middle of such, like this:
That you can write in it and the line stays there, like a "line background", but inside the td
Any ideas?
The idea is, in a table, inside a td put a line in the middle of such, like this:
That you can write in it and the line stays there, like a "line background", but inside the td
Any ideas?
There are many ways
1) Add HTML <strike>
or <del>
.
2) use css property, text-decoration: line-through;
3) Using CSS:
td{
border: 1px solid black;
position: relative;
}
td:after{
content: "";
display: block;
width: 100%;
height: 1px;
background-color: black;
position: absolute;
top: 50%;
}
EDIT: Since there is a bug in firefox related to position: relative and td element, wrap the text in a div of each td and use the same above css.
EDIT 2: In the comments below, @NicoO showed that the firefox bug can be resolved by giving line-height: 0
to the tr
element.
Here is the working one - Result Fiddle
HTML
<td><i class="line"></i>This Is demo Text</td>
CSS
.line{
width:100%;
height:0;
border-bottom:1px solid #111;
float:left;
margin:0;
position:absolute;
z-index:0;
top:50%;
left:0
}
You can try to create an image (1px width and height of your td) and use background-image property in css like this:
td{
background-image: url('relative/path/to/your/image');
}
I just tested doing it with a span, and it worked, but other solutions might be much more elegant.