I have a table that includes buttons for adding rows.
Question: I am looking to hide the table element and add a show click event on the "Add" button. Here is an example of the HTML code:
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading text-center">
<h4 class="panel-title">
Department (input)
</h4>
</div>
<table class="table table-bordered">
<tr>
<th>Number</th>
<th>Department Type</th>
<th>District Type</th>
<th>Start Points</th>
<th>Delete</th>
</tr>
<tr *ngFor="let row of rowDataMainForm; let mainFormIndex = index">
<td>
<input type="text" class="form-control">
</td>
<td>
<select class="form-control">
<option selected>-----</option>
<option value="D">D</option>
<option value="B">B</option>
<option value="P">P</option>
</select>
</td>
<td>
<select class="form-control">
<option selected>-----</option>
<option value="Primary">Primary</option>
<option value="Secondary">Secondary</option>
<option value="Temporary">Temporary</option>
</select>
</td>
<td>
<div class="panel panel-default smaller">
<table class="table table-condensed table-bordered">
<thead>
<tr>
<th>number</th>
<th>radius</th>
<th>X</th>
<th>Y</th>
<th>Height</th>
<th>Geometry</th>
<th>Rockets</th>
<th></th>
</tr>
</thead>
<tr *ngFor="let newrow of row.tochkiStartaForms; let TochkiStartaFormIndex = index">
<td>
<input type="text" class="form-control">
</td>
<td></td>
<td>
<input type="text" class="form-control">
</td>
<td>
<input type="text" class="form-control">
</td>
<td>
<input type="text" class="form-control">
</td>
<td></td>
<td>
<div class="panel panel-default smaller">
<table class="table table-condensed table-bordered">
<thead>
<tr>
<th>Type</th>
<th>Type CH</th>
<th>Quantity</th>
<th></th>
</tr>
</thead>
<tr *ngFor="let suchnewrow of newrow.rocketForms; let RocketFormIndex = index">
<td></td>
<td></td>
<td></td>
<td>
<button (click)="deleteRowRocketForm(newrow.rocketForms, RocketFormIndex)" type="button" class="btn btn-default" style="padding: 2px;">
Delete
</button>
</td>
</tr>
</table>
<div class="panel-footer">
<div class="container-build">
<button (click)='addRowRocketForm(newrow.rocketForms)' type="button" class="btn btn-default" style="padding: 2px">
Add
</button>
</div>
</div>
</div>
</td>
<td>
<button (click)='deleteRowTochkiStartaForm(row.tochkiStartaForms, TochkiStartaFormIndex)' type="button" class="btn btn-default" style="padding: 2px">
Delete
</button>
</td>
</tr>
</table>
<div class="panel-footer">
<div class="container-build">
<button (click)='addRowTochkiStartaForm(row.tochkiStartaForms)' type="button" class="btn btn-default" style="padding: 2px">
Add
</button>
</div>
</div>
</div>
</td>
<td>
<button (click)="deleteRowMainForm(rowDataMainForm, mainFormIndex)" type="button" class="btn btn-default" style="padding: 2px">
Delete
</button>
</td>
</tr>
</table>
<div class="panel-footer">
<div class="container-build">
<button (click)='addRowMainForm(rowDataMainForm)' type="button" class="btn btn-default" style="padding: 2px">
Add
</button>
</div>
</div>
</div>
I am aware of using [hidden], but how can it be implemented in this case?