I have the output <td><?= h($book->price) ?></td>
now i'd like to add a strikethrough tag to the output if $book->sales_price
is not null. How would I add the code for strikethrough?
if($book->sales_price){
//add strikethrough
}
Thank you very much!
Use the strike through tag <s> Sample Text </s>
or <strike> Sample Text </strike>
Sample Text
if(is_null($book->sales_price)) {
<td><?= h($book->price) ?></td>
} else {
<td><s><?= h($book->price) ?></s></td>
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.