Tryit Editor v1.8

Source Code:
<!DOCTYPE html> <html> <head> <script> function displayResult() { document.getElementById("myTable").style.borderCollapse="collapse"; } </script> </head> <body> <table id="myTable" border="1"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$150</td> </tr> </table> <br> <button type="button" onclick="displayResult()">Collapse border</button> </body> </html>
Result:
W3Schools.com - Try it yourself