function addColumn(name) {
  // append new column header
  $("#main-table tr:first").append("<td id='fn_" + name + "'>" + name + "</td>");

  var rows = $("#main-table tr");
  for (var i = 1; i < $("#main-table tr").length - 1; i++) {
    var rowId = rows[i].id;
    var [chan, fn1, fn2] = rowId.split("/");
    if (name == fn1 || name == fn2) {
      // add the name at the end to know under each function is this cell id
      var tdId = chan + "_" + fn1 + "_" + fn2 + "_" + name;
      $("#main-table tr:eq(" + i + ")").append("<td id='" + tdId + "'>o</td>");
    } else {
      $("#main-table tr:eq(" + i + ")").append("<td></td>");
    }
  }
}
// TODO: add columns so that they are alphabetically sorted
add columns so that they are alphabetically sorted
add columns so that they are alphabetically sorted
function addColumn(name) {
  $("#main-table tr:first").append("<td id='fn_" + name + "'>" + name + "</td>");
  var rows = $("#main-table tr");
  for (var i = 1; i < $("#main-table tr").length - 1; i++) {
    var rowId = rows[i].id;
    var [chan, fn1, fn2] = rowId.split("/");
    if (name == fn1 || name == fn2) {
      var tdId = chan + "_" + fn1 + "_" + fn2 + "_" + name;
      $("#main-table tr:eq(" + i + ")").append("<td id='" + tdId + "'>o</td>");
    } else {
      $("#main-table tr:eq(" + i + ")").append("<td></td>");
    }
  }
}
function addColumn ( name ) { $ ( "#main-table tr:first" ) . append ( "<td id='fn_" + name + "'>" + name + "</td>" ) ; var rows = $ ( "#main-table tr" ) ; for ( var i = 1 ; i < $ ( "#main-table tr" ) . length - 1 ; i ++ ) { var rowId = rows [ i ] . id ; var [ chan , fn1 , fn2 ] = rowId . split ( "/" ) ; if ( name == fn1 || name == fn2 ) { var tdId = chan + "_" + fn1 + "_" + fn2 + "_" + name ; $ ( "#main-table tr:eq(" + i + ")" ) . append ( "<td id='" + tdId + "'>o</td>" ) ; } else { $ ( "#main-table tr:eq(" + i + ")" ) . append ( "<td></td>" ) ; } } }
TODO: add columns so that they are alphabetically sorted
TODO : add columns so that they are alphabetically sorted
// append new column header // add the name at the end to know under each function is this cell id