如何从查询结果导出html表到php中的docx

hey ia m using tableExport plugins for html table exporting. Here my html table is formed by query results.I want to export that table to word format. But exported format is not like word. pls help me..

<script src="<? echo base_url(); ?>application/assets/js/jquery-1.10.1.min.js" type="text/javascript"></script>
<script type="text/javascript" src="<? echo base_url(); ?>application/assets/js/table_export/tableExport.js"></script>
<script type="text/javascript" src="<? echo base_url(); ?>application/assets/js/table_export/jquery.base64.js"></script>
<script type="text/javascript">
    $(document).ready(function (e) {
        $("#doc_id").click(function (e) {
            $("#sample_editable_1").tableExport(function (e) {
                type :'doc'

            });
        });
    });
</script>

<table class="table striped hover bordered" id="sample_editable_1">
    <thead>
    <tr>
        <th rowspan="2" id="eval_style">Roll No</th>
        <th rowspan="2" id="eval_style">Student Name</th>
        <?php foreach($subject_list->result() as $row_subject) { ?>
            <th rowspan="2" id="eval_style"><?php echo $row_subject->subject_name; ?></th>
        <? } ?>
        <th rowspan="2" id="eval_style">View</th>
    </tr>
    </thead>
    <tbody>
    <?php if( $narrative != '' ) {
        $result1 = $narrative->result_array();
        for($i = 0; $i < count($result1); $i ++) {
            ?>
            <tr>
                <td><? echo $result1[ $i ]['roll_num']; ?></td>
                <td><? echo $result1[ $i ]['student_name']; ?></td>
                <?php for($j = 0; $j < count($subject1); $j ++) {
                    $col = 'narrative_'.$subject1[ $j ];
                    if( $result1[ $i ][ $col ] != '' ) {
                        ?>
                        <td><? echo $result1[ $i ][ $col ]; ?></td>
                    <? }
                    else {
                        ?>
                        <td><? echo "-"; ?></td>
                    <? } ?>


                <? } ?>
                <td id="table_body">
                </td>
            </tr>
        <? }
    } ?>
    </tbody>
</table>