I have Laravel code in Blade like this :
<span id="pk_dens" name="pk_dens" >
{{$productpages->pk_dens}}%
</span>
So in
it will add space in class like text- danger
and text- success
so class not apply
so how can I avoid that spce in if else condition ?
CodePudding user response:
Use ternary operator
<span id="pk_dens" name="pk_dens" >
{{$productpages->pk_dens}}%
</span>
CodePudding user response:
I think you are missing here is ?
in ternary syntax and to remove space just remove all white spaces from the span
tag and make it in just one line.
<span id="pk_dens" name="pk_dens" >{{$productpages->pk_dens}}%</span>