Friday, October 7, 2011

Hide html row in the table

Today I will show you how to hide row in the table by using JavaScript. In following code you have to pass true or false to show parameter you can add "displayRow function" to a button click or text change.



function displayRow(show) {
  var row = document.getElementById("hideRow");

  if (row != null) {
    if (show) row.style.display = '';
    else row.style.display = 'none';
  }
}

html code for table

1 2 3
4 5 6
7 8 9

0 comments:

Post a Comment