Skip to content
TheChatArchiveThe Chat Archive
o3-2025-04-16· OpenAIHugging Face LMArena Human Preference 140K

<ng-container matColumnDef="gender"> <th mat-header-cell matHeaderCellDef>Gender</th>…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Qwenqwen3-235b-a22b-no-thinking’s answer.
  1. User

    add icons like below code liek above <th mat-header-cell *matHeaderCellDef>Gender <td mat-cell *matCellDef="let match"> {{ match.person?.gender || 'Unknown' | titlecase }}

  2. Assistant

    Below is a plug-and-play version of the second column that shows

    • an icon for male, female, or unknown
    • the gender text right next to the icon (optional – remove the span if you only want the icon).

    <!-- Gender column with icons -->
    <ng-container matColumnDef="gender">
      <th mat-header-cell *matHeaderCellDef>Gender</th>
    
      <td mat-cell *matCellDef="let match">
        <!-- Choose the correct icon -->
        <ng-container [ngSwitch]="match.person?.gender">
          <!-- Male -->
          <mat-icon *ngSwitchCase="'male'"
                    color="primary"
                    aria-label="Male icon">male</mat-icon>
    
          <!-- Female -->
          <mat-icon *ngSwitchCase="'female'"
                    color="accent"
                    aria-label="Female icon">female</mat-icon>
    
          <!-- Anything else / Unknown -->
          <mat-icon *ngSwitchDefault
                    color="warn"
                    aria-label="Unknown gender icon">help_outline</mat-icon>
        </ng-container>
    
        <!-- Optional: keep the text beside the icon -->
        <span style="margin-left:4px">
          {{ (match.person?.gender || 'Unknown') | titlecase }}
        </span>
      </td>
    </ng-container>
    

    What you need to make it work

    1. Import MatIconModule in the module that declares your table component.
    2. Make sure the Material icons font is loaded in your index.html (Angular Material’s getting-started step already adds it):
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    

    That’s it—now the column behaves just like your first example, but wired to match.person?.gender. 🎉

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.