Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<html>
<head>
<style type="text/css">
table.collapseColumns td {
visibility: hidden;
}
</style>
<script type="text/javascript">
<!--
function setupTables() {
var tables = document.getElementsByTagName('table');
for (var tableLoop=0; tableLoop<tables.length; tableLoop++) {
if (tables[tableLoop].className == 'collapseColumns') {
var headerRow = tables[tableLoop].tHead.rows[0].cells;
for (var cellLoop=0; cellLoop<headerRow.length; cellLoop++) {
headerRow[cellLoop].onclick = toggleColumn;
headerRow[cellLoop].style.cursor = 'pointer';
}
}
}
}
function toggleColumn() {
var table = this.parentNode.parentNode.parentNode;
var columnNumber = this.cellIndex;
var isShowing = (table.tBodies[0].rows[0].cells[columnNumber].style.visibility == 'visible');
var rows = table.tBodies[0].rows;
for (var rowLoop=0; rowLoop<rows.length; rowLoop++) {
rows[rowLoop].cells[columnNumber].style.visibility = isShowing ? 'hidden' : 'visible';
}
}
//-->
</script>
</head>
<body onload="setupTables();">
<table border="1" class="collapseColumns">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cell 1, 1</td>
<td>Cell 1, 2</td>
<td>Cell 1, 3</td>
</tr>
<tr>
<td>Cell 2, 1</td>
<td>Cell 2, 2</td>
<td>Cell 2, 3</td>
</tr>
<tr>
<td>Cell 3, 1</td>
<td>Cell 3, 2</td>
<td>Cell 3, 3</td>
</tr>
</tbody>
</table>
</body>
</html>