Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Customize html:label size

 
Erwan Lacoste
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm looking for a way to customize the html:label size according to the content.
example : lets say I need to print the word "FOO", my label tag should have the size "50". But if i print "FOOBAR", the size should be "100".
Any ideas?
thanx in advance.
 
Vani Bandargal
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to do this dynamically on client side,say on change of some event then in Javascript you can check innerHTML td tag. (since you said lable, I assume that you are printing in td tag). Make sure that td has some id

if (document.getElementById("td_Id").innerHTML=='XXXX')
{
document.getElementById("td_Id").innerHTML='<font size=4>XXXX</font>';
}

if it is not on some event on client side then you can add font tag to the value on server side code itself.
If you use c out jstl, add escapeXML="false"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic