I want to hide a substring in a table cell. Let's assume the table looks like this:
<div id="table">
<table>
<tr>
<td> Blah </td>
<td> Blah [100, 100]</td>
<td> Blah [130, 70]</td>
</tr>
</table>
</div>
How can I use jQuery (and CSS) to hide the [100,100] part of cell 2 and the [130, 70] part of cell 3?
I found this solution in another answer for a similar problem:
<div class="text">Good Stuff Hide Me</div>
<div class="text">Great Stuff Hide Me</div>
<div class="text">Best Stuff Hide Me</div>
$('div.text').html(function (i, t) {
return t.replace('Hide Me', '<span class="hidden">Hide Me</span>');
})
But I think I would need a regex solution since the contents of the [ ] part can be different? or is there a better iea?