Answer the question
In order to leave comments, you need to log in
How to get the number of rows and put them in the column on the left by numbering them?
There is a code example (column on the right) how to count the number of lines and number them in the column on the left, displaying the line numbering (1,2,3,4,5 ...)
And the problem with repeating the code for other blocks (
https:// jsfiddle.net/sp_true/f9dg63r2/1/
Answer the question
In order to leave comments, you need to log in
const rowsCount = content.split('\n').length;
It remains to display the line numbers in the loop.
rowNumbers.innerHTML = Array(rowsCount).fill(0).map((_,i)=>`<span>${i+1}</span>`).join('<br>');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question