2016-07-12 49 views
0

我有下面的JSP代碼,打印頁面上像
如何格式化日期以大寫字母打印

USE BY:APR/04/2017年

現在我希望它打印爲

使用由:APR/04/2017

儘管label.global.useBy的值是「Use By」,但由於我在CSS中定義的樣式,它的大寫。我已經做到了在所有CAPS中呈現月份。否則,它是越來越打印爲

使用由:四月/ 04/2017年

可否請你建議爲我如何能保持「使用的」原樣和凸狀部使本月在帽,如:

使用由:APR/04/2017年

<td class="contentArea"><bean:message key="label.global.useBy"/>: <bean:write name="details"property="expirationDate" formatKey="format.date.certificate" /></td> 

相關CSS

.contentArea { 
    font-family: Verdana, Arial, Helvetica, sans-serif; 
    font-size: 12px; 
    font-weight: bold; 
    color: #000000; 
    text-transform: uppercase; 
} 
+0

您可以請提供生成的HTML。您可以添加課程或使用派生選擇器來創建日期資本。 –

+0

@RahulKapuriya如何將類添加到屬性「expirationDate」?或者我如何使用TD內的財產的派生選擇器。你能建議嗎? – user3223509

+1

只需在瀏覽器中呈現HTML即可。例如:​​使用: Apr/04/2017

回答

1

感謝@Rahul Kapuriya, 我用SPAN標籤內TD像這樣,

<td class="contentArea"><bean:message key="label.global.useBy"/>: <span style="font-weight:bold; text-transform: uppercase;"><bean:write name="details" 
    property="expirationDate" formatKey="format.date.certificate" /><span></td> 

謝謝!

1

「歡迎你」 -Rahul Kapuriya

您可以使用<strong>標籤,這樣你就不必添加樣式font-weight:bold

像這樣:

<td class="contentArea"><bean:message key="label.global.useBy"/>: <strong style="text-transform: uppercase;"><bean:write name="details" 
property="expirationDate" formatKey="format.date.certificate" /><strong></td>