I have this html
<tr>
<td>Test</td>
<td>324</td>
</tr>
My default CSS is text-align:left
But I want to apply text-align:center to any <td> that contains digits.
I have about 50 HTML files so I can’t add class manually.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use
filterand some regex magic:The above regex is a bit simple, if you need more precision use this one:
The above will match
(space)123and123(space)but not123aorasd 123so basically only numbers and spaces allowed if that’s what you’re looking for. To add more valid characters just put them like[^\s,], that will make the comma,valid too.