I am running a code that scrapes a form and then opens a new browser tab with the data using the format: fieldID, fieldLabel, filedValue
jQuery(document).ready(function(){jQuery('#helpdesk_ticket_submit').on('click', function(e){
submitText = "<table class='table'>"
submitText += ` <thead>
<tr>
<th scope="col">fieldID</th>
<th scope="col">fieldLabel</th>
<th scope="col">fieldValue</th>
</tr>
</thead>
<tbody>`
jQuery('#new_helpdesk_ticket input, #new_helpdesk_ticket select, #new_helpdesk_ticket textarea').each(
function(index){
var input = jQuery(this);
if (input.prev().is('textarea'))
if (input.attr('class').indexOf('hide') >= 0)
return;
let label = extractLabelText(input.attr('id')) //extrenal function to get the label of the field
submitText += "<tr><td>" + input.attr('id') + "</td><td>" + label + "</td><td> " + input.val() + "</td></tr>"
}
);
window.open().document.write(submitText);
there is nothing wrong with the code. My question is when I do window.open().document.write(submitText);
how can I format the table with bootstrap?