I have a table with some dynamically generated data. The issue is I want to select all <td>'s that has numeric (formatted or non-formatted) data type and apply some style to them. How best can I do this with jQuery or JavaScript?
Any help or suggestions would be appreciated. Thank you.
<table>
<tr>
<th>Days</th>
<th>Booth 1</th>
<th>Booth 2</th>
<th>Booth 3</th>
</tr>
<tr>
<td>Monday</td>
<td>12,000</td>
<td>2,500</td>
<td>0</td>
</tr>
<tr>
<td>Tuesday</td>
<td>4,200</td>
<td>0</td>
<td>3,500</td>
</tr>
<tr>
<td>Wednesday</td>
<td>Out Of Order</td>
<td>Busy</td>
<td>11,540</td>
</tr>
</table>
How about something like
Which uses a simple regex to match a digit then zero or more digits or commas or decimal points inside
<td>elements. Then you can perform whatever action you like on the element.