html / php中的多色TD?

| 我正在尝试寻找一种使我的td或表多色的方法。
echo \"<table  padding=\\\"0\\\" spacing=\\\"0\\\" 
  style=\\\"background-color:yellow; width: 100%; margin-left: 2px; 
  width: 100%; line-height: 80% ;\\\">\";
echo \"<tr>\";
echo \"<td class=\\\"bgfiller\\\">
  <font style=\\\"color: black;  font-size:90%; \\\" >
   \".$rowbis[\'Lnaam\'].\" - \".$rowbis[\'Type_name\'].\"</font>
  </td></tr>\";
我的bgfiller样式如下所示:
.bgfiller{
  width: 10px;
  background-color: red;
  z-index: 1 ; 
}
因此,我想做的是制作一个黄色的块,其中有一个10px的小块(将在以后的状态中由变量设置),并在其上放置一些文本。 因此,您将获得诸如进度条之类的文字。但是文本必须使用表格的完整宽度,仅使用10px。 任何人都知道我如何使它工作?     
已邀请:
首先,请取消
<font>
标签。只要将
font-size: 90%; color: black;
添加到现有的
.bgfiller
规则中,就没有理由了。 但是,要回答您的问题,我建议采取以下措施:
<div style=\"width: 200px; border: 1px solid black; position: relative;\">
    Hello There I am Text
    <div style=\"width: 30px; background: yellow; position: absolute; left: 0; top: 0; z-index: -1;\">&nbsp;</div>
</div>
请参阅:http://jsfiddle.net/knWuf/     
像这样的东西要干净得多,但是您到底想对文本做什么? 演示:http://jsfiddle.net/WVvLD/
<div><span>Progress</span><div>
div {
    background-color: yellow;
}
span {
    background-color: red;
    display:block;
    width: 10px;
}
    
如果您想继续使用表,这可能是一个解决方案:
<table width=\"100%\">
 <tr>
        <td><span></span>this is an text</td>     
 </tr>
</table>
和风格
td{
background-color:green;
    width:100%;
    position:relative;
    z-index:-2;
}
td span{
    position:absolute;
    width:20px;
    height:20px;
    background-color:darkred;
    z-index:-1;
}
http://jsfiddle.net/WVvLD/34/     

要回复问题请先登录注册