【问题标题】:Cakephp - how to add strikethrough to outputCakephp - 如何在输出中添加删除线
【发布时间】:2016-07-02 03:57:13
【问题描述】:

我有输出<td><?= h($book->price) ?></td> 现在如果$book->sales_price 不为空,我想在输出中添加删除线标记。如何添加删除线代码?

if($book->sales_price){
//add strikethrough
}

非常感谢!

【问题讨论】:

    标签: html css cakephp-3.0


    【解决方案1】:

    使用删除线标记<s> Sample Text </s><strike> Sample Text </strike>

    示例文本

    if(is_null($book->sales_price)) {
      <td><?= h($book->price) ?></td>
    } else {
      <td><s><?= h($book->price) ?></s></td>
    }
    

    【讨论】:

      猜你喜欢
      • 2011-05-23
      • 1970-01-01
      • 2021-08-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多