const tableRows2 = frequencyconsumptionMerged.map((row, rowIndex, allRows) =>
    row.map(cell => {
        // Match percentage followed by optional superscript letter (e.g., "39%A")
        const match = cell.match(/^(\d+%)\s*([A-Za-z])?$/);

        let textParts;
        if (match) {
            // Split into value and superscript if letter exists
            textParts = [
                { text: match[1], options: { fontSize: 8 } },
            ];
            if (match[2]) {
                textParts.push({
                    text: match[2],
                    options: { fontSize: 6, superscript: true }
                });
            }
        } else {
            // No superscript needed
            textParts = [{ text: cell, options: { fontSize: 8 } }];
        }

        return {
            text: textParts,
            options: {
                border: (rowIndex === 0 || rowIndex === allRows.length - 1)
                    ? [false, false, false, false]
                    : [false, false, true, false],
                borderColor: 'e0e0e0',
                borderSize: 0.5,
                align: 'center',
                valign: 'middle'
            }
        };
    })
);
