Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

137
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda