Update 2013-01-04
:before
with CSS content instead of HTML is a better way to go.Information
I have a table with some content. Depending on the depth I have a number of minus characters before the text.
Problem / question
I can't figure out how to make the text align right and the minus characters to align left, even when line break accur. The number of minus and the text length can vary.
Example on jsfiddle
Edit it if you like...
http://jsfiddle.net/Rjvc9/
HTML if jsfiddle don't work
<table>
<td>
<span class="lines">----</span> <span class="text">My page that is far too long for it to fit on one row</span>
</td>
</table>
<br>
This is how it should work.<br><br>
<table>
<td>
<span class="lines">----</span> <span class="text">My page that is far<br> too long for it to fit<br>
on one row</span>
</td>
</table>
CSS if jsfiddle don't work
table {
background: #eee;
width: 150px;
}
td {
font-family: Arial;
font-size: 14px;
line-height: 18px;
margin: 40px;
}
My thoughts
text-indent
!A text-indent
indents the first line. So give it a negative value!
.first-line {text-indent: -5em; padding-left: 5em;}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With