Call the print method in the Table of antd and find that the printed data is not aligned with js

due to the need to add printing function, that is, to bring up the printer"s pop-up window interface, it just so happens that the form uses the antd table, and I find that no matter which node I put the id of printTable on, I will not align the form

the following code calls up the print function interface

var tableToPrint = document.getElementById("printTable");//
var newWin= window.open("");//
newWin.document.write(tableToPrint.outerHTML);//
newWin.document.close();//IE
newWin.focus();//IE
newWin.print();//
newWin.close();//

the following picture shows one of the Table Demo on antd"s official website

https://codesandbox.io/s/jn3yj82nm3


you just put html in a new window, but css doesn't have

.

pay attention to this sentence:

  print < / Link > 
)
}

Menu