title: How to set dynamically the width of a html table column according to its text content?
body: <p>There is a <code>html</code> <code>table</code> :</p>
  
  <pre><code>&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;
     &lt;tr&gt;
        &lt;td width="480px"  class="societe" &gt;&lt;div style="float:left;font-size:12px;padding-top:2px" &gt;&lt;?php echo $_SESSION[PROJET_REF] ?&gt; - [&lt;?php echo $_SESSION[MANUEL_REF] ?&gt;]&lt;/div&gt;
        &lt;/td&gt;
     &lt;/tr&gt;
     ...
  &lt;/table&gt;
  </code></pre>
  
  <p>The <code>css</code> "societe" is :</p>
  
  <pre><code>.societe{
  
      text-align:left;
      padding-left:23px;
      font-size:11px;
      font-weight:bold;
  
      background: url(../include/images/societe.png) repeat-x;
  
      }
  </code></pre>
  
  <p>In the <code>column</code> definition : <code>&lt;td width="480px"  class="societe" &gt;</code> I hard-coded the column's width to 480px. It's not very good to do that ! So how to make the width dynamically to fit with the column's text width ? Here the text is <code>&lt;?php echo $_SESSION[PROJET_REF] ?&gt; - [&lt;?php echo $_SESSION[MANUEL_REF] ?&gt;</code>.</p>