D
D
Daniel Besedny2017-07-18 21:45:05
Microsoft Office
Daniel Besedny, 2017-07-18 21:45:05

When copying a table with an auto-incrementing field (numbering) from Word to a site post on Wordpress, the numbered field is not copied. How to solve the problem?

I'm trying to copy a table, but it's pasted onto the page, without the first column. It includes numbering (or auto-numbering, forgot). Unfortunately, I can’t refuse this column, but manually entering it is long and tedious. Is there a solution without using plugins and intricate dances? Maybe in Word there is an opportunity to number the rows in the table so that wordpress can see it too?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Besedny, 2017-07-20
@danbes1

I'll answer my own question:

jQuery.noConflict(); // fix '$'
jQuery(document).ready(
   function($) {
      $(function(){
         // для каждой таблицы
         $('table tbody').each(function() {
            var $table = $(this);
            // исключая первую строчку для каждой последующей добавляется number
            $('tr:not(:first) td:first-child', $table).each(function (number) {
               $(this).html(number+1);
            });
         });
         $(this).show();
      });
   }
);

Incorrectly, I apparently asked the question, but this is the answer to the question: "How to use jQuery to number rows in a table?"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question