title: How can I stretch text to horizontally fit dynamically generated div?
body: <p>My code parses an external page and creates a div to display that page's data. I found a script here on stack overflow that is supposed to stretch a text to a div width, this one <a href="http://jsfiddle.net/webtiki/DPRr9/" rel="nofollow">http://jsfiddle.net/webtiki/DPRr9/</a>, but I'm not being able to make it work with my script, it looks like it is not working because my code's div is generated dynamically, so the jQuery code actually isn't seeing any div to integrate to. </p>
  
  <pre><code>&lt;?php
      $xml = new DOMDocument();
      @$xml-&gt;loadHTMLFile('http://v2.afilio.com.br/aff/aff_boutique_show_ads.php?boutiqueid=37930-895777&amp;currencypos=0&amp;display_img=1&amp;diplay_name=1&amp;diplay_price=1&amp;thumbsize=80%&amp;truncate_desc=1&amp;numrows=1&amp;numcols=9&amp;colorname=000000&amp;colorprice=E30000&amp;bkcolor=FFFFFF&amp;bordercolor=FFFFFF&amp;self_target=0&amp;');
  
      $products = array();
  
      //Loop through each &lt;td&gt; tag in the dom and extract inner html    
      foreach($xml-&gt;getElementsByTagName('td') as $p) {
          $children  = $p-&gt;childNodes;
          $phtml = '';
          foreach ($children as $child)
          {
              $phtml.= $p-&gt;ownerDocument-&gt;saveHTML($child);
          }
  
          echo '&lt;div id="mainproductafilioright"&gt;&lt;div class="product"&gt;' . $phtml . '&lt;/div&gt;&lt;/div&gt;';
      }
  ?&gt;
  </code></pre>
  
  <p>The line that generates the div is:</p>
  
  <pre><code>echo '&lt;div id="mainproductafilioright"&gt;&lt;div class="product"&gt;' . $phtml . '&lt;/div&gt;&lt;/div&gt;';
  </code></pre>