Reputation: 640
I am working on an app in Grails 2.3.6
I want to add text color to the Date object in GSP view. I tried the following and this didn't work.
<td><g:formatDate date="${myClassInstance.lastName}" style="color: green;"/></td>
Is there a way to add color to g:formatDate?
Upvotes: 0
Views: 249
Reputation: 24776
Put your class on the surrounding element such as the td
or add a <span></span>
around your date. g:formatdate
does not return HTML but rather just text.
<td style="color: green;"><g:formatDate date="${myClassInstance.lastName}"/></td>
or
<td><span style="color: green;"><g:formatDate date="${myClassInstance.lastName}"/></span></td>
Upvotes: 2