Glyphicon 按钮 onclick 切换 table

Glyphicon Button onlick toggle table

http://jsfiddle.net/LZoesch/xovrr3uo/

<div class="container">
    <div class="panel panel-default">
        <form method="POST" action="">
            <button class="btn btn-default btn-sm pull left" name="reset"><span class="glyphicon glyphicon-stats"></span>

            </button>
            <button type="submit" class="btn btn-default btn-sm pull-right" name="reset"><span class="glyphicon glyphicon-refresh"></span>

            </button>
        </form>
    </div>
</div>
<div>
<table class="table2">
    <div id="chartCanvas" style="padding-left:5px;">
                <canvas id="canvas" style="width:98%;height:500px;"></canvas>
        <br>
    </div>
    </tbody>
    <script type="text/javascript">
      script goes here for chart.js
    </script>

</table>

正在尝试让字形切换 on/off 为 table "table2"

'table2' table 标签不合适。 Table 应该在 table.

中包含行和单元格元素
<table>
  <tr>
    <td>{{DATA}}</td>
  </tr>
</table>

按照上面的语法,在单元格中添加内容。

现在使用 jsfiddle link click here 获取有关如何切换 table.

的 JQuery 代码

Js fiddle代码:

$(".glyphicon-stats").on('click', function () {
$('.table2').toggle();

});

如果需要任何其他帮助,请告诉我。

更新jsfiddle link http://jsfiddle.net/mvamsianil/xovrr3uo/8/