Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to repeat a character in HTML?

Tags:

html

css

Is there any way to repeatedly print a character inside a table cell in HTML (NOT HTML5!)?

*(only using HTML OR using HTML and CSS ONLY)

** Need to print "." through the full length of a cell. Don't know the exact width of the cell!

like image 750
CRoshanLG Avatar asked Oct 31 '12 08:10

CRoshanLG


1 Answers

Ok after u elaborated your question I have the solution. A div with a dotted bottom border and text with a white background on top.

example :

CSS:

.line{
    border-bottom:1px dotted black;
    position:relative;
    height:16px;
}

.line span{
    display:inline-block;
    position:relative;
    background:white;
    bottom:-2px;
    height:100%;
    padding:0 5px;
}
.line .price{
    position:absolute;
    right:0;
}​

HTML:

<div class="line">
    <span class="title">name</span>
    <span class="price">123.23$</span>
</div>
<div class="line">
    <span class="title">name</span>
    <span class="price">123.23$</span>
</div>​

http://jsfiddle.net/bKuVe/

like image 99
Rene Koch Avatar answered Oct 01 '22 18:10

Rene Koch