Chinh Do

WBR HTML Tag

First time here? Check out my greatest hits or look around in the archives, and consider subscribing to the latest posts via RSS or email. I am also on Twitter and Google Plus. Thanks for visiting.
13th January 2011

WBR HTML Tag

The little known WBR tag is great for formatting HTML tables. Add it to specific places in your table cell values to give the browser the option to add a line break there. This is very useful when displaying tables with long strings that would otherwise cause horizontal scrolling.

Here’s a sample table, displaying some info. Since the values in the tables do not have spaces or tabs, the browser is forced to display the values on one line:

Key Value
ChinhDo.TestApp.TestClass.ExampleKey1 this.is.an.example.of.a.very.long.string

Here’s the same table, with <wbr/> tags inserted where periods are:

Key Value
ChinhDo.TestApp.TestClass.ExampleKey1 this.is.an.example.of.a.very.long.string

posted in Programming, Tips | 0 Comments

  • Calendar

  • January 2011
    M T W T F S S
    « Sep   Apr »
     12
    3456789
    10111213141516
    17181920212223
    24252627282930
    31