Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

131
Views
how to Add font to table style for printing

I added a font path to the table style. But the font does not apply. I feel there is a problem with my code and how to address it. Please check the code and find the problem.

<script>

    function printDiv() {
        var divToPrint = document.querySelectorAll('.print-table');
        var htmlToPrint = '' +
            '<style type="text/css">' +
            'table th, table td {' +
            '@@font-face{font-family: Vazir  !important ;src: url("~/dist/fonts/Vazir-Medium.ttf") format("truetype");}' +
            'font-family:Vazir;' +
            'border:1px solid #000;' +
            'padding:0.5em;' +
            '}' +
            '</style>';

        divToPrint.forEach((item) => {
            htmlToPrint += item.outerHTML;
        })
        newWin = window.open("");

        newWin.document.write(htmlToPrint);
        newWin.print();

        newWin.close();
    }

    var elem = document.getElementById("intro");
    elem.style.textAlign = "center";

</script>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!