What I have is, I did a mistake
I aligned my tabular data like this
<tr>
<td> first row </td>
<td> second row </td>
<td> third row </td>
</tr>
<tr>
<td> first row </td>
<td> second row </td>
<td> third row </td>
</tr>
now to fix the mistake I want to copy the content of the second tr
next to the first and enclose it with tr
s
e.g.
<tr>
<td> first row </td> <td> first row </td>
<td> second row </td> <td> second row </td>
<td> third row </td> <td> third row </td>
</tr>
then do this manually:
<tr><td> first row </td> <td> first row </td> </tr>
<tr> <td> second row </td> <td> second row </td></tr>
<tr><td> third row </td> <td> third row </td></tr>
is there a nicer way than doing it manually? I tried using ALT
mode , but it would repeat everything, e.g. the whole copied block for each line.
This can be done using IntelliJ's column selection mode. Press Ctrl+Shift+A (⌘+Shift+A on Mac) and select Edit: Column selection mode. You can then select the second block of <td>
elements, cut them, move the cursor spanning 3 lines to the first block and paste it after the original <td>
elements.
Here is a gif illustrating the process:
If Column Selection Mode
is turned off, you should turn it on. It's in the Edit
menu, about half way down. You can also turn it on (or off) with the keyboard shortcut Alt+Shift+Insert on Windows - not sure what the macOS equivalent is.
Once you turn on that mode, you just use Shift+↑ or Shift+↓ to add a cursor to the row above or below.
It's not quite the same as what you get with Sublime Text, but hopefully that's good enough to do whatever you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With