tags:

views:

32

answers:

2

Hi,

I have a table with width of 250 px, I am creating this table using a stringbuilder, but when I add long strings to table data, the data renders as one long line, it does not stay in table.

When I use firebug I see that the table is 250 px, but data does not wrap within it.

Help pls! thanks!

EDIT: was using whitespace:nowrap; from another CSS which was messing it all up. thx for help

+1  A: 

You can prevent a table from expanding for long strings by giving it the style table-layout: fixed.

kbrimington
thanks but as I mentioned and verified with firebug the table itself is not expanding and is rendering at 250px. the text in the <td></td> however, is running way past the right border
aolle
@aolle: Firebug tells you how the cell is styled. Clearly the cell is not actually 250px wide. Tables will flex unless explicitly told not to.
kbrimington
A: 

Hi!

Couple of things that you may try:

  1. Inject a style into the td that is behaving bad: style="word-wrap:break-word;"
  2. Check out the following to see if it helps: http://stackoverflow.com/questions/1258416/word-wrap-in-a-html-table

Hope it helps!

Vaibhav