0

I have a page where I need to print a chart (svg element) and an html table. Everything is fine here...The small issue what i have here is that the table is not using the total width available in the page to print and also is not taking the style of table. Here is my code:

  public print() {
        var popUpAndPrint = function () {
            var container = $('#container');
            var keyNumbers = $('#HtmlTableDIV');
            var mySVG: any = $("#container div svg");
            keyNumbers.appendTo(container);
            var width: any = mySVG.width();
            var height = mySVG.height();
            var printWindow = window.open('', 'PrintMap',
                'width=' + width + ',height=' + height);
            printWindow.document.writeln(container.html());
            printWindow.document.close();
            printWindow.print();
            printWindow.close();
        };
        setTimeout(popUpAndPrint, 500);
    }

and the result it is:in the browser

enter image description here

Rolando
  • 752
  • 1
  • 14
  • 41

0 Answers0