2017-11-25 1 views
0

Ich habe Probleme mit dem Styling ng-template Tag.
, was ich bisher in meiner CSS-Datei versucht:
Wie style angular ng-template selector

  • mit #other_content als ID in meiner CSS-Datei
  • Hinzufügen einer Klasse zu <ng-template>
  • Styling alle <td> Tags

Es funktioniert nicht und nach der Suche habe ich keine Lösung gefunden.

HTML:

<div class="cont"> 
    <div class="scolldiv"> 
     <table border="1"> 
      <thead> 
       <tr> 
        <th>Char</th> 
        <th>Break After</th> 
        <th>Remove</th> 
       </tr> 
      </thead> 
      <tbody> 
       <tr *ngFor="let charobj of Chars;let i = index" [attr.data-index]="i"> 
        <td>{{charobj.char}}</td> 
        <td class="tdcell" *ngIf= "charobj.after; else other_content">YES</td> 
        <ng-template #other_content>NO</ng-template> 
        <td> 
         <MyBtn 
          [ID]="'btnaddchars_' + i" 
          [BackColor]= "globals.sysButtonBackColor" 
          [Color]= "globals.sysButtonForeColor" 
          [HoverBackColor] = "globals.sysHoverButtonBackColor" 
          [HoverColor] = "globals.sysHoverButtonForeColor" 
          [Text] ="'Delete'" 
          [SecondText]="'Close'" 
          [Width] ="'70px'" 
          [Height]="'17px'" 
          (buttonWasClicked) ="onSymbolsFormButtonClick($event)" 
          > 
         </MyBtn> 
        </td> 
       </tr> 

      </tbody> 
     </table> 
    </div> 
</div> 

Image:

enter image description here

Antwort

0

Sie haben die

<td class=..> </td> 

um die NO mit dem ngIf da den gesamten Tag zu setzen, ist durch die ersetzen Vorlage im Fall sonst.

+0

danke, funktioniert perfekt! – jonathana