What friends do I have these barcodes, but I need the name of the product to be above and the price below in a focused way, I tried with <br>
\n
and nothing,
I would really appreciate your help.
This is the code:
$(document).on("click",".btn-view-barcode", function(){
codigo_barra = $(this).val();
nombre = $(this).closest("tr").find("td:eq(3)").text();
precio = $(this).closest("tr").find("td:eq(6)").text();
cantidad = $(this).closest("tr").find("td:eq(9)").text();
html = "<div class='row'>";
for (var i = 1; i <= Number(cantidad); i++) {
html += "<div class='col-xs-6'>";
html += nombre;
html += "$. " +precio;
html += "<svg id='barcode"+i+"'></svg>";
html += "</div>";
}
html += "</div>";
$("#modal-barcode .modal-body").html(html);
for (var i = 1; i <= Number(cantidad); i++) {
JsBarcode("#barcode"+i, codigo_barra, {
displayValue: true,
height: 65,
width: 1.3,
fontsize: 4,
// textPosition: "bottom",
// textAlign: "center",
// textMargin: 0.5,
format: "EAN13",
lineColor: "#000000",
//marginLeft: 1,
});
}
});
And these bar codes:
These are the results courtesy of @dTobon