如何将 HTML 放在 Laravel Blade 中的 <td> 中?

How to put HTML inside a <td> in Laravel Blade?

我想把 Bootstrap 图标放在我的 blade..但问题是我无法得到实际的输出..意思是这里是示例代码:

@if (($row->is_management) === 1)
       <td> <span class="glyphicon glyphicon-ok"></span> </td>
 @else
       <td><span class="glyphicon glyphicon-remove"></span></td>
 @endif

表示如果状态为 1,则绿色选中将出现,在另一种情况下为红色交叉。

谁能告诉我这里的实际错误是什么?

 @if (($row->is_management) == 1)
       <td> <span class="glyphicon glyphicon-ok"></span> </td>
 @else
       <td><span class="glyphicon glyphicon-remove"></span></td>
 @endif

试试这个,用==代替===

更新代码:

 @if (($row->is_management) == 1)
      {{ <td> <span class="glyphicon glyphicon-ok"></span> </td> }}
 @else
      {{ <td><span class="glyphicon glyphicon-remove"></span></td> }}
 @endif

它将在 bootstrap css 上使用 glyphicons 字体。请确保您已调用 bootstrap css 并具有字形字体