• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Customize html:label size

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"
 
Thanks tiny ad, for helping me escape the terrible comfort of this chair.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic