CSS
body { font-size: 12px; } .ProgressBar { position: absolute; width: 100px; /* 宽度 */ border: 0px solid #B1D632; padding: 0px; } .ProgressBar div { display: block; position: absolute; background: #B1D632; color: #333333; height: 15px; /* 高度 */ line-height: 15px; /* 必须和高度一致,文本才能垂直居中 */ } .ProgressBar div span { position: absolute; width: 100px; /* 宽度 */ text-align: center; font-weight: bold; }
JS;
<script type="text/javascript"> var template = '<div class="ProgressBar"><div style="width: {0}%;"><span>{0}%</span></div></div>'; function bfb(value) { return String.format(template, value).toString(); } </script>
HTML:
<ext:Column Header="百分比" DataIndex="DEPTNO" Width="101"> <Renderer fn="bfb" /> </ext:Column>更多详细信息请查看 java教程网 http://www.itchm.com/forum-59-1.html