prosseek
prosseek

Reputation: 190809

Changing the border with of a table with jQuery?

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?

Upvotes: 3

Views: 13032

Answers (3)

Damien-Wright
Damien-Wright

Reputation: 7544

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

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

:)

Upvotes: 3

Bhanu Prakash Pandey
Bhanu Prakash Pandey

Reputation: 3785

use

 document.getElementById('myTable').border="0"
<table border="1" class="docutils" id="myTable">

Upvotes: 1

JasCav
JasCav

Reputation: 34632

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

$('table.docutils').attr('border', '0');

Upvotes: 10

Related Questions