How can I apply select2 dropdown design continuously when adding rows in javascript?

Hello can you help me finding a way on this. This is my code for adding rows. Thanks for who’s gonna help.

function myCreateFunction() {
var table = document.getElementById(“taxtable”);
var length = $(’.sl’).length;
var i = parseInt(length)+parseInt(1);
var row = table.insertRow(1);

var cell1 = row.insertCell(0); // id
cell1.innerHTML = “”;

var cell2 = row.insertCell(1); // delete button
cell2.innerHTML = “”;

var cell3 = row.insertCell(2); // type
cell3.innerHTML = “Select TypeREPRESENTATIONGASOLINEVEHICLE REPAIRS(GOODS)VEHICLE REPAIRS(SERVICE)”;

var cell4 = row.insertCell(3); // date
cell4.innerHTML = “”;

var cell5 = row.insertCell(4); // invoice
cell5.innerHTML = “”;

var cell6 = row.insertCell(5); // vat/tin no
cell6.innerHTML = “

<?php $selecttin = 'SELECT tax_reg_num1 FROM Vendor'; $execselecttin = sqlsrv_query($con,$selecttin); while($arrayselecttin = sqlsrv_fetch_array($execselecttin)){ echo ''.$arrayselecttin['tax_reg_num1'].''; } ?>
”;

var cell7 = row.insertCell(6); // vendor
cell7.innerHTML = “”;

var cell8 = row.insertCell(7); // name
cell8.innerHTML = “”;

var cell9 = row.insertCell(8); // address1
cell9.innerHTML = “”;

var cell10 = row.insertCell(9); // address2
cell10.innerHTML = “”;

var cell11 = row.insertCell(10); // city
cell11.innerHTML = “”;

var cell12 = row.insertCell(11); // vatable?
cell12.innerHTML = “”;

var cell13 = row.insertCell(12); // invoice total
cell13.innerHTML = “”;

var cell14 = row.insertCell(13); // vatable sales
cell14.innerHTML = “”;

var cell15 = row.insertCell(14); // non vat sales
cell15.innerHTML = “”;

var cell16 = row.insertCell(15); // vat
cell16.innerHTML = “”;

var cell17 = row.insertCell(16); // acct
cell17.innerHTML = “”;

var cell18 = row.insertCell(17); // uc3
cell18.innerHTML = “”;

var cell19 = row.insertCell(18); // uc4
cell19.innerHTML = “”;

$(function () {
//Initialize Select2 Elements
$(’.select2’).select2()

//Initialize Select2 Elements
$('.select2bs4').select2({
  theme: 'bootstrap4'
})

})

}