<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.0.js"></script>
        <script type="text/javascript">
            $(function () {
                $('#button').click(function () {
                    var url = 'data:application/vnd.ms-excel,' + encodeURIComponent($('#tableWrap').html())
                    location.href = url
                    return false
                })
            })
        </script>
        <style type="text/css">

        </style>
        <title>Untitled</title>
    </head>
    <body>
        <button id="button">click me</button>
        <div id="tableWrap">
            <table class="table-black">
                <thead>
                    <tr>
                        <th>حازم</th><th>B</th><th>C</th></tr>
                </thead>
                <tbody>
                    <tr><td>1</td><td>2</td><td>3</td></tr>
                    <tr><td>1</td><td>2</td><td>3</td></tr>
                    <tr><td>1</td><td>2</td><td>3</td></tr>
                    <tr><td>1</td><td>2</td><td>3</td></tr>
                </tbody>
            </table>
        </div>
    </body>
</html>