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

347
Views
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 answers
Answer question

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 Report
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!