Javascript examples for CSS Style Property:borderCollapse
Set the borderCollapse property:
<!DOCTYPE html> <html> <head> <style> td, th { border: 1px solid black; } </style>//ww w .ja va 2s.c o m </head> <body> <table id="myTable" style="border-collapse:collapse;"> <tr> <th>Month</th> <th>Dollor</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$150</td> </tr> </table> <br> <button type="button" onclick="myFunction()">Test</button> <script> function myFunction() { document.getElementById("myTable").style.borderCollapse = 'separate'; } </script> </body> </html>