function t431__setColumnsWidth(colWidth, colsNumber, recId) { if (colWidth) { return colWidth[0]; } else { var tableWidth = document.querySelector('#rec' + recId + ' .t431 .t-container .t-col'); var computedWidth = parseFloat(getComputedStyle(tableWidth, null).width.replace('px', '')); return computedWidth / colsNumber + 'px'; }}function t431__generateTable(arrayValues, colTag, hasTargetBlank, colWidth, maxColNumber, recId) { const tableWrapper = document.querySelector('#rec' + recId + ' .t431__table-wrapper'); const isNofollow = tableWrapper.getAttribute('data-nofollow'); let html = ''; let tag = ''; if (colTag == 'td') { tag = 'tbody'; } else { tag = 'thead'; } html += '<' + tag + ' class="t431__' + tag + '">'; for (var i = 0; i < arrayValues.length; i++) { /*add classes for striped table*/ if (colTag == 'td') { if ((i + 1) % 2 > 0) { html += '<tr class="t431__oddrow">'; } else { html += '<tr class="t431__evenrow">'; } } else { html += '<tr>'; } var addingCols = 0; if (arrayValues[i].length < maxColNumber) { addingCols = maxColNumber - arrayValues[i].length; } for (var j = 0; j < arrayValues[i].length + addingCols; j++) { const item = arrayValues[i][j]; if (item) { /*define col width*/ var currentWidth = ''; if (Array.isArray(colWidth) && colWidth[j]) { currentWidth = colWidth[j].myText; } else if (!Array.isArray(colWidth)) { currentWidth = colWidth; } var colWithAttr = ''; if (colTag == 'td') { colWithAttr = '<td class="t431__td t-text" ' + (currentWidth ? 'width="' + currentWidth + '"' : '') + '>'; } else { colWithAttr = '<th class="t431__th t-title" ' + (currentWidth ? 'width="' + currentWidth + '"' : '') + '>'; } if (item.myHref) { /*define link type*/ var linkWithAttr = ''; var linkCloseTag = ''; const targetAttr = hasTargetBlank ? 'target="_blank"' : ''; if (item.myHrefType == 'link') { linkWithAttr = '<a href="' + item.myHref + '"' + targetAttr + (isNofollow ? ' rel="nofollow"' : '') + '>'; linkCloseTag = '</a>'; html += colWithAttr + linkWithAttr + item.myText + linkCloseTag + '</' + colTag + '>'; } else { const rec = document.querySelector('#rec' + recId); const btnTemplate = rec.querySelector('.t431__btn-template'); const button = btnTemplate ? createBtnFromTemplate(btnTemplate, item, targetAttr) : createBtnDefault(item, targetAttr); html += colWithAttr + button + linkCloseTag + '</' + colTag + '>'; } } else { html += colWithAttr + item.myText + '</' + colTag + '>'; } } else { html +=