Adding a class="  " to a column in a table

In preparing a table I wanted to highlight the entries in the first column. The page was Ctrl.html">Control of StrongED from Keyboard - it had several different tables.

All table entries were of this type

<tr><td>Home</td> <td>Start of text</td></tr>
<tr><td>End</td> <td>End of text</td></tr>
<tr><td>Up</td> <td>Caret up</td></tr>
<tr><td>Down</td> <td>Caret down</td></tr>

Search "<tr><td>"@1*@2"</td>"
Replace"<tr><td><span class=\"mt\">"@12"</span></td>"
In a instant, 141 entries were changed!

The Search expression

"<tr><td>"@1*@2"</td>" contains a start string then a marker @1. Markers do not affect the search string - they are simply there to tell the replace string what to do.
* means search forward in the text for the next item - which is another string.

The replace expression

"<tr><td><span class=\"mt\">"@12"</span></td>" I started off by simply copying the search string, replacing @1*@2 by @12, the adding the bits I needed to add, in the correct places.

Was this page helpful? Please email me and/or rate this page:

If you want a reply make sure any email address will not get spam-binned!
Optional comment

Other relevant pages

Top of page

Page Information Document URI:
Page first published Saturday the 30th of December, 2017
Last modified:Wed, 06 Mar 2019 19:14:36 GMT
© 2017 - 2024 Richard Torrens.