Preview:
// !-------------------------  model table row count ------------------------------------------------------

  var trElements;

  var tr_count;

  const count_row = () => {
    // console.log()

    var tbodyElement = document.querySelector(".tbody");

    trElements = tbodyElement.querySelectorAll("tr");

    var numberOfTr = trElements.length;

    console.log("Number of <tr> elements in tbody: " + numberOfTr);

    for (let i = 0; i < trElements.length; i++) {
      tr_count = i;

      setTr_countt(tr_count);

      console.log("i is ==>", i);
    }

    // document.querySelector(".td_data").innerHTML = 1;
  };

  // console.log(trElements);

  console.log("first", tr_count);

  // console.log(numberOfTr);

  // count_row();


downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter