470,588 Members | 2,126 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,588 developers. It's quick & easy.

percentage indicator

SK
How to achieve this*? Percentage number is always in
the middle of the table. If needed, the number is overlayed
over the cell border (for example, in case of "55%").
Thanks,

-----------------------------------
| | |
| | 35% |
| | |
-----------------------------------
-----------------------------------
| | |
| 75% | |
| | |
-----------------------------------
* For viewing, non-proportional font required.


Jul 20 '05 #1
2 2782
Also sprach SK:
How to achieve this*? Percentage number is always in
the middle of the table. If needed, the number is overlayed
over the cell border (for example, in case of "55%").


Quick, dirty and tested only on IE5:

<div id="progress">
<div id="done"></div>
<div id="percent">55%</div>
</div>

#progress {
position:relative;
width:200px;
border:1px solid black;
}

#done {
width:55%;
background-color:green;
}

#percent {
position:absolute;
top:0;
left:90px;
color:red;
}

Drawback: the percentage is not exactly in the middle, but maybe you can
improve this code.

Greetings,
Thomas

Jul 20 '05 #2
SK
[snip]

Great, exactly what I need. Thanks.
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jack Russell | last post: by
10 posts views Thread by Koen Janssens | last post: by
6 posts views Thread by DebbieG | last post: by
1 post views Thread by Marko Vuksanovic | last post: by
14 posts views Thread by Frank Swarbrick | last post: by
80 posts views Thread by nicolas.sitbon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.