By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,739 Members | 1,059 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,739 IT Pros & Developers. It's quick & easy.

percentage indicator

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
SK
[snip]

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

This discussion thread is closed

Replies have been disabled for this discussion.