Can anyone help me figure out how to add parameters to a print function? I only want to print a specific table, but when I try to print it, the entire page gets printed instead.
Here's my code:
let tableContent = document.getElementById('tablename').innerHTML
When I alert(tableContent)
, it shows the correct value. However, when I try to print(tableContent)
, the entire page is printed. I've also tried using print(tableContent)
and tableContent.print
, but neither of these solutions work.
If anyone knows the solution to this problem, I would greatly appreciate the help!