PHP ile excel html tablo

0 Cevap php

Ben diğer benzer sorulara cevap için baktım ama yararlı göremiyordu ..

I have an html table generated with php from mysql db. I use this fragment in my php file to save as excel

$file="program.xls";
header('Content-Type: text/html');
$table = $_POST['tablehidden'];//i get this from another php file.It is HTML table
header("Content-type: application/x-msexcel"); //tried adding  charset='utf-8' into header
header("Content-Disposition: attachment; filename=$file");
echo $table;
  1. Bu zamana kadar her şey tamam. Ben bu kaydederken ama karakter sorunu olsun ve charset='utf-8' benim başlığı içine eklemek için bilmiyorum ama bu çalışmıyor çalıştı.
  2. Ben HTML tarzı ile benim tablo var ama excel geldiğinde css uygulanan stilini kaybetti.

Ben nasıl charset ve stil sorunları çözebilir? Ben phpexcel baktım ancak doğrudan bir tablo eklemek için bir yöntem göremiyordu.

0 Cevap