Level 63
Do you know this package ?
It is really great to work with Laravel and it has a function to set RTL.
https://docs.laravel-excel.com/3.1/exports/extending.html#rtl-right-to-left-sheets
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Below is my Java script code to export my table result into excel file format but I need the header font be bold and also the page displays from right to left in excel file, since the language is Arabic.
<script>
function ExportToExcel(type, fn, dl) {
var elt = document.getElementById('tblexp');
var wb = XLSX.utils.table_to_book(elt, { sheet: "sheet1" });
return dl ?
XLSX.write(wb, { bookType: type, bookSST: true, type: 'base64' }) :
XLSX.writeFile(wb, fn || ('MySheetName.' + (type || 'xlsx')));
}
</script>
<div class="input-group"><button class=" btn btn-secondary" onclick="ExportToExcel('xlsx')">Export table to excel</button></div>
Please or to participate in this conversation.