clone of HTML tables of data
I've refactored your code below to add some of the repetitive items into functions and tried to improve your variable names a little.
The new variable names and function names should clearly indicate their intended purpose/data.
A rule of thumb worth remembering is the concept of DRY (Do not Repeat Yourself).


const createArraywithJsonData = function(count, data) {
    let array = [];
    
    for (let i = count; i &lt; data.length; i += count) {
        array.push(data.slice(i, i + count));
    }
    
    return array;
}

const editTableId = function(selector, counter) {
    $(`#d-page-${(counter+1)}`).find(`#${selector}-0`, "table").prop("id", `${selector}-${(counter+1)}`);
}

const appendDataToTable = function(array, property, selector) {
    for (let x = 0; x &lt; array.length; x++) {
        let k = array[x];

        for (let y = 0; y &lt; k.length; y++) {
            $(`#${selector}-${x}`).append(`&lt;tr&gt;&lt;td&gt;${array[x][y][property]}&lt;/td&gt;&lt;/tr&gt;`);
        }
    }
}

let d1 = [
    {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }, {
        a: "1"
    }
];
let d2 = [
    {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }, {
        b: "2"
    }
];

let ar1 = createArraywithJsonData(7, d1);
let ar2 = createArraywithJsonData(21, d2);
let longestArrayLength = ar1.length &gt; ar2.length ? ar1.length : ar2.length;


for (let v = 0; v &lt; longestArrayLength - 1; v++) { //clone div using longest array length
    $("#d-page-0").clone().prop("id", `d-page-${(v + 1)}`).insertAfter(`#d-page-${v}`); //clone div, edit id
    editTableId('e-tbl', v);
    editTableId('w-tbl', v);
}

appendDataToTable(ar1, 'a', 'e-tbl');
appendDataToTable(ar2, 'b', 'w-tbl');
&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
&lt;!DOCTYPE html&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""&gt;
  &lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt;
  &lt;/head&gt;

  &lt;body bgcolor="#A0A0A0" vlink="blue" link="blue"&gt;
    &lt;div id="d-page-0"&gt;
        &lt;table id="e-tbl-0"&gt;
            &lt;tr&gt;&lt;th&gt;tbl1&lt;/th&gt;&lt;/tr&gt;
        &lt;/table&gt;

        &lt;table id="w-tbl-0"&gt;
            &lt;tr&gt;&lt;th&gt;tbl2&lt;/th&gt;&lt;/tr&gt;
        &lt;/table&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;