Changing the border with of a table with jQuery?

2019-07-03 22:47发布

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?

3条回答
Fickle 薄情
2楼-- · 2019-07-03 22:49

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

$('table.docutils').attr('border', '0');
查看更多
叛逆
3楼-- · 2019-07-03 23:11

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

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

:)

查看更多
Summer. ? 凉城
4楼-- · 2019-07-03 23:12

use

 document.getElementById('myTable').border="0"
<table border="1" class="docutils" id="myTable">
查看更多
登录 后发表回答