3

I have a table generated from Sphinx that has a border of width 1.

<table border="1" class="docutils">

Can I change the border width to 0 using jQuery/javascript?

prosseek
  • 182,215
  • 215
  • 566
  • 871

3 Answers3

9

Yes you can. You want to use the attr() function like this...

$('table.docutils').attr('border', '0');
JasCav
  • 34,458
  • 20
  • 113
  • 170
3

I would tend to use the .css() function as opposed to .attr()... eg:

$("table.docutils").css('border', 'none');

:)

Damien-Wright
  • 7,296
  • 4
  • 27
  • 23
1

use

 document.getElementById('myTable').border="0"
<table border="1" class="docutils" id="myTable">
Bhanu Prakash Pandey
  • 3,805
  • 1
  • 24
  • 16