crabbly / Print.js

A tiny javascript library to help printing from the web.
MIT License
4.32k stars 673 forks source link

I can't justify content to center . see file #611

Open Arafat-Thabet opened 2 years ago

Arafat-Thabet commented 2 years ago
function printTable(table_id = '') {
        var title = 'overtime insurance -for approved [payroll';
        var logo = '<img align="center" src="logo.png" />';

        var name = logo + '<br><h3>title 1</h3>';
        var new_content = '<div style="width:100%;">';
        new_content += '<link rel="stylesheet" href="'+ base_url()+'asset/new_css/bootstrap.min.css">';
        new_content += logo + name + '<h3>' + title + '</h3><br><table style="margin-left:auto;margin-right:auto;" class="table table-bordered" id="table-h"  >' + $('#' + table_id).html() + '</table>';
        new_content += '</div>';

        $("#print").html(new_content);

        printJS({
            printable: 'print',
            type: 'html'
        });
        $("#print").empty();

    }