这里有一个 html
table
:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="480px" class="societe" ><div style="float:left;font-size:12px;padding-top:2px" ><?php echo $_SESSION[PROJET_REF] ?> - [<?php echo $_SESSION[MANUEL_REF] ?>]</div>
</td>
</tr>
...
</table>
css
中的"societe"是:
.societe{
text-align:left;
padding-left:23px;
font-size:11px;
font-weight:bold;
background: url(../include/images/societe.png) repeat-x;
}
在
column
定义中:<td width="480px" class="societe" >
我硬编码了列的宽度为480像素。这样做并不是很好!那么如何使宽度根据列文本的宽度动态调整?在这里,文本是<?php echo $_SESSION[PROJET_REF] ?> - [<?php echo $_SESSION[MANUEL_REF] ?>
。