How cna I a add comma between words in a td if there is more than one word
<p>Long backstory on this, and this seems to be the simplest solution. I have a table that will populate with user id's from a database. I need to figure out a way to add a comma between id's if there is more than one. The td id is <code>username</code>.</p>

<p>I'm not sure where to really start. I would need to index it and see if the html is > 1. And if so, add a comma between each word. Please help. This is a p.o.c forum and it doesn't suit me to add/use jQuery, so I need to do it in vanilla JavaScript.</p>

<p>Here is the code that pulls it from the database:</p>

<pre><code>if ($this-&gt;post['post_thanks_amount'] &gt; 0 &amp;&amp; $this-&gt;thread['isdeleted'] == 0)
{
    $this-&gt;post['post_thanks_bit'] = fetch_thanks_bit($this-&gt;thread['forumid'], $thanks);
    $this-&gt;post['post_thanks_user'] = $post_thanks_user;
    $this-&gt;post['post_thanks_amount_formatted'] = vb_number_format($this-&gt;post['post_thanks_amount']);
    $post_thanks_box = fetch_post_thanks_template($this-&gt;post);
}
</code></pre>

<p>And the output with one user is this:</p>

<pre><code>&lt;tr valign="top"&gt;
    &lt;td style="background:#E8E8E8;" colspan="2" class="alt1"&gt;
        &lt;div&gt;
            &lt;a rel="nofollow" href="member.php?u=20420"&gt;ninja1&lt;/a&gt;
            &lt;a rel="nofollow" href="member.php?u=26154"&gt;testuser&lt;/a&gt;
        &lt;/div&gt;
    &lt;/td&gt;
&lt;/tr&gt;
</code></pre>

<p>so after each <code>&lt;a...&gt;</code> if there is more than one, add a comma.</p>
