PHP Excel download Korean problem

Asked 2 years ago, Updated 2 years ago, 67 views

Hi, everyone.

If you press the Export button in php, the contents of the table are exported to an Excel file.

As shown in the picture above, the Excel file is downloaded very well only when the table contents are in English.

But

If you press the button like in the picture above, it will not react. Excel cannot be downloaded only if Korean is included.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="Scripts/jquery-2.0.1.min.js"></script>
    <script src="Scripts/jquery.btechco.excelexport.js"></script>
    <script src="Scripts/jquery.base64.js"></script>
</head>
<body>
    <div id="dv">
        <table id="tblExport" style="border:1px solid black; ">
            <thead>
                <tr>
                    <th>#</th>
                    <th>First</th>
                    <th>Second</th>
                    <th>Name</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td style='background-color:red;'>1</td>
                    <td>Mark</td>
                    <td>Otto</td>
                    <td>@mdo</td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>Jacob</td>
                    <td>Thornton</td>
                    <td>@fat</td>
                </tr>
                <tr>
                    <td>3</td>
                    <td>Larry</td>
                    <td>the Bird</td>
                    <td>@twitter</td>
                </tr>
            </tbody>
        </table>
    </div>
    <div>
        <button id="btnExport">Export</button>
    </div>
</body>
</html>
<script>
    $(document).ready(function () {
        $("#btnExport").click(function () {
            $("#tblExport").btechco_excelexport({
                containerid: "tblExport"
               , , datatype: $datatype.Table
            });
        });
    });
</script>

How can I download Korean?

However, when I press the button, I want to bring only the table part and send it to an Excel file.

php codeigniter mysql excel

2022-09-22 20:46

1 Answers

Please add the following to Html.

<meta http-equiv="Content-Type" content="application/vnd.ms-excel;charset=euc-kr">


2022-09-22 20:46

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.