Table column width is stretched left and right

this is a code I saw on the Internet

    var tTD; //Table Cell,
    var table = document.getElementById(val);
    for (let j = 0; j < 2; jPP) {
      console.log(table.rows[0].cells[j], "jjjjj");
      table.rows[0].cells[j].onmousedown = function () {
        //
        tTD = this;
        if (event.offsetX > tTD.offsetWidth - 10) {
          tTD.mouseDown = true;
          tTD.oldX = event.x;
          tTD.oldWidth = tTD.offsetWidth;
        }
        //Table
        //table = tTD; while (table.tagName !=  "TABLE") table = table.parentElement;
        //tTD.tableWidth = table.offsetWidth;
      };
      table.rows[0].cells[j].onmouseup = function () {
        //
        if (tTD == undefined) tTD = this;
        tTD.mouseDown = false;
        tTD.style.cursor = "default";
      };
      table.rows[0].cells[j].onmousemove = function () {
        //
        if (event.offsetX > this.offsetWidth - 10)
          this.style.cursor = "col-resize";
        else
          this.style.cursor = "default";
        //Table Cell
        if (tTD == undefined) tTD = this;
        //
        if (tTD.mouseDown != null && tTD.mouseDown == true) {
          tTD.style.cursor = "default";
          if (tTD.oldWidth + (event.x - tTD.oldX) > 0)
            tTD.width = tTD.oldWidth + (event.x - tTD.oldX);
          //
          tTD.style.width = tTD.width;
          tTD.style.cursor = "col-resize";
          //Cell
          table = tTD; while (table.tagName != "TABLE") table = table.parentElement;
          for (j = 0; j < table.rows.length; jPP) {
            table.rows[j].cells[tTD.cellIndex].width = tTD.width;
          }
          //
          //table.width = tTD.tableWidth + (tTD.offsetWidth  tTD.oldWidth);
          //table.style.width = table.width;
        }
      };
    }
    
    
    

clipboard.png
if this is the case, how to modify the use.

Apr.27,2021
The content in

cell is made width adaptive. When the width of the outer cell changes, the browser will redraw and the elements inside will be redrawn. The width of the inner element is set to a percentage so that it can scale automatically.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-7b92f0-8b71.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-7b92f0-8b71.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?