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

245
Vistas
Cambiar automáticamente el tamaño del área de texto al imprimir

Quiero aumentar automáticamente el tamaño del área de texto al imprimir. Estoy intentando de esta manera, pero no está aumentando el tamaño:

 var linha = ``; linha += `<textarea class="area2 dentro" rows="1" data-min-rows="1">Teste Teste Teste Teste Teste Teste Teste Teste Teste Teste Teste Teste Teste Teste Teste Teste Teste Teste Teste Teste Teste Teste Teste </textarea>`; $("#retorc6").html(linha); document.getElementById("btnPrint1").onclick = function () { printElement(document.getElementById("printThis1")); } function printElement(elem) { var domClone = elem.cloneNode(true); var $printSection = document.getElementById("printSection"); if (!$printSection) { var $printSection = document.createElement("div"); $printSection.id = "printSection"; document.body.appendChild($printSection); } console.log($printSection); $printSection.innerHTML = ""; $printSection.appendChild(domClone); window.print(); }
 @media screen { #printSection { display: none; } } @media print { body * { visibility:hidden; } #printSection, #printSection * { visibility:visible; } #printSection { position:absolute; left:0; top:0; } textarea { min-height: 900px; } }
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <button type="button" class="btn btn-info show-side-btn escoprint" id="btnPrint1" data-show="show-side-navigation1" style="float:right;"><i class="fa fa-print" aria-hidden="true"></i></button> <div id="printThis1" class="printThis1"> <form role="form" action="#!" id="retorc6"> </form> </div>

Pero de esta manera el tamaño no se ajusta al texto al imprimir. El objetivo es al imprimir ajustar el área de texto al tamaño del texto. ¿Alguien puede ayudar?

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