https://i.sstatic.net/CTSup.pngI have a table displaying various values in HTML format, like so:
Name : Arun Kumar
Phone(R) : 7604215454
(M):
Email: [email protected].
There are cases where certain labels are empty as there is no value for them in the database. I want to hide these labels if there's no corresponding value from the database and only display them when a value is returned. For example, in the context above, I would hide the label (M) if it has no value and only show it along with its value when there is one. Any help on how to solve this issue? I am new to Angular 5. Thank you!
Below is an example code snippet:
<table>
<tr>
<th style="font-weight:bold ; width: 30%;vertical-align: top;">Name</th>
<br>
<th style="font-weight:bold;">{{item.name}} </th>
</tr>
<tr>
<th style="font-weight:bold;">Phone(R)</th>
<br>
<th style="font-weight:500;">{{item.mobile}}</th>
</tr>
<tr >
<th style="font-weight:bold;text-align: right; padding-right: 8%">(M)</th>
<br>
<th style="font-weight:500;">{{item.phone}}</th>
</tr>