how to get first 200 char of a text without breaking an html tag?
<p>EDIT : sry if i was unclear, the second option, getting the first 200 characters and closing the tags left open.</p>

<p>i'm currently loading articles from other website via DOM object (the other website have no RSS)</p>

<p>I want to make a "preview" of that article, but here's my problems:</p>

<p>1) i do not control how the articles are written, therefore it seems to always be inside a table on the second TR (they use a CMS and it is messy - see exemple below)</p>

<p>2) they have A LOT of html tags, i don't want to leave one open.</p>

<p>3) i need to keep the html format, i know it's ugly but it fits perfectly in my page.</p>

<p>Not my code (in french sry)</p>

<pre><code>&lt;table&gt;

&lt;TR &gt;

&lt;TD class='Normal' valign="top" colspan="2" style="padding-bottom:15px;"&gt;13-01-2012   &lt;b&gt;Water-polo – Championnat pan-pacifique&lt;b &gt;&lt;/TD&gt;

&lt;/TR&gt;&lt;TR &gt;

&lt;TD class='Normal' valign="top"&gt;&lt;span class="HeadTitleNews"&gt; Les Canadiennes disputeront le bronze aux Chinoises&lt;/span&gt;   &lt;img src='http://www.sportcom.qc.ca/Portals/0/2011WaterpoloF.jpg' width='165' align='right' class='imgAnnouncementCss'&gt;&lt;div style="margin: 0in 0in 0pt"&gt;&lt;span style="font-family: Tahoma; font-size: 10pt"&gt;Montr&amp;eacute;al, 13 janvier 2012 (Sportcom) &amp;ndash; L&amp;rsquo;&amp;eacute;quipe f&amp;eacute;minine canadienne de water-polo a remport&amp;eacute; une victoire &amp;eacute;crasante de 19-3 face au Br&amp;eacute;sil, vendredi, au Championnat pan-pacifique de Melbourne, en Australie. Les Canadiennes se sont ainsi assur&amp;eacute;es de participer au match pour la m&amp;eacute;daille de bronze contre les Chinoises. &lt;/span&gt;&lt;/div&gt;

&lt;div style="margin: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/div&gt;

&lt;div style="margin: 0in 0in 0pt"&gt;&lt;span style="font-family: Tahoma; font-size: 10pt"&gt;La Montr&amp;eacute;alaise &lt;strong&gt;Sophie&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family: Tahoma; font-size: 10pt"&gt; Baron-La Salle&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: Tahoma; font-size: 10pt"&gt; a marqu&amp;eacute; quatre buts dans la victoire. &lt;/span&gt;&lt;/div&gt;

&lt;div style="margin: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/div&gt;
</code></pre>

<p>Thanks</p>
