JSFiddle - React, Tailwind, and code Playground
by Lalji Tadhani
HTML
<div class="productslist">
<label class="lblproductname">Test</label>
<label class="lblproductqty">12</label>
<label class="lblproductprice">10</label>
</div>
JavaScript
$.each($('.productslist').not(":first"), function (index, element) {
var productname = $(element).find('.lblproductname').text();
var lblproductqty = $(element).find('.lblproductqty').text();
var lblproductprice = $(element).find('.lblproductprice').text();//Product Name After 16 space & Product QTY after Space 10
printText("" + productname.substr(0, 19).padEnd(22) + "" + lblproductqty.padEnd(11) + "" + lblproductprice + " \n", 0, 0, false, false, false, 0, 0);
});