Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

355
Visualizações
How can i change the padding o element by class name

im trying to change the padding of all the td in table. somehow it doesnt work. can you help ?

script ->

enter image description here

css ->

enter image description here

html ->

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

As Martin said in the comments ID's are unique selectors, so for apply style for td tag in script, you can use some thing like this:

<script>
  let td = document.getElementsByTagName('td');
  for (i = 0; i < td.length; i++) {
  td[i].style.padding = "20px";
  }
</script>

or change Id to class: strHtml += '<td class="curr-cell">'

and use document.getElementsByClassName('curr-cell') in above code.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda