• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with HTML table and formatting

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey,

I have a problem with formatting a table in html using css.

My table consists of 6 columns whereas the 2nd column contains a string which is quite long. As you can see in the screenshot I get a scrollbar in order to view the last 2 column. Is there any way I can have line breaks for the 2nd column, or any other way so that the whole table fits in the area rather than having to scroll.

Screenshot:


thanks in advance.

 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could use the CCS3 word-wrap property. But that's as far only supported in IE and Safari.

As a client side alternative you could make the cell content a block element make use of its overflow property. This way you get a scrollbar in the cell instead of in the page.

As a server side alternative you need to break long words before output using some utility method. If you're using JSP/EL, you could even wrap it in an EL function.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic