collapse and overflow

by david

HTML

<table>
  <tr>
    <td>cell1</td>
    <td rowspan="2">Overflow Overflow Overflow</td>
  </tr>
  <tr id="rowToChange">
    <td>hihi</td>
  </tr>
</table>

<button style="position:absolute; top:75px" id="changeVisibility">
  Change Visibility
</button>

CSS

table {
  font-size:20px;
}
td {
  max-width: 50px;
  white-space: nowrap;
  border: 1px solid red;
}

JavaScript

states = ["visible", "collapse"];
current = 0;
changeVisibility.onclick = function() {
  current = !current + 0;
  rowToChange.style.visibility = states[current];
}