I have a very long string.
I want to append <br/>
after every 80 characters so it can displayed nicely in the inner HTML.
Is there any easy way?
Double-click on the cell in which you want to insert the line break (or press F2). This will get you into the edit mode in the cell. Place the cursor where you want the line break. Use the keyboard shortcut – ALT + ENTER (hold the ALT key and then press Enter).
Of course, there are situations in which there is need to add line breaks. You can do so by simply hitting Shift + Return or Shift + Enter , respectively.
Do it with long_string.replace(/(.{80})/g, "$1<br>");
Check it here: http://jsfiddle.net/x2YJp/
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