Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I double underline a text inside a html table cell?

Both underline should be of length corresponding to the text content. I've come across another similar question where the accepted solution was to use

.doubleUnderline {
text-decoration:underline;
border-bottom: 1px solid #000;
}

But this is not what I wanted. I want the length of the double underline to be equal to the length of the text content.

like image 923
Abinash Koirala Avatar asked Oct 19 '25 08:10

Abinash Koirala


1 Answers

I've whipped two examples.

With block elements (like p) you can use inline-block so it doesn't go the full length of page and just the text.

span{
  border-bottom:1px solid #000;
  text-decoration:underline;
}
        
p{
  border-bottom:1px solid #000;
  text-decoration:underline;
  display:inline-block;
}
<span>This is a bit of text for you</span>
<br>
<p>This is some text for you too</p>
like image 200
Albzi Avatar answered Oct 21 '25 21:10

Albzi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!