asp.net creating a table with stringbuilder, text in <td> does not wrap or break lines, runs straight off page
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开发者_StackOverflow社区. thx for help
You can prevent a table from expanding for long strings by giving it the style table-layout: fixed
.
Couple of things that you may try:
- Inject a style into the
td
that is behaving bad:style="word-wrap:break-word;"
- Check out the following to see if it helps: Word-wrap in an HTML table
Hope it helps!
精彩评论