Search code examples
htmlcsshtml-tablecross-browserinternet-explorer-7

Can I encourage table-cell text to line wrap?


I have one entire column of a table who's header consists of a question and in the following rows contains only a checkbox...

------------------------------------------------------
| Would you like this text to wrap ? | <rest of row> |     <-- <th>
-------------------------------------+----------------
|                []                  + <rest of row> |     <-- <tr>        
-------------------------------------+----------------
|                []                  + <rest of row> |     <-- <tr>   

It looks unsightly to me. Can I use any markup to "encourage" browsers to render it like this...

---------------------------
| There,  |               |
| isn't   |               |
| that    | <rest of row> |     <-- <th>
| nicer?  |               |
----------+----------------
|   []    |               |     <-- <tr>
----------+----------------
|   []    |               |     <-- <tr>
----------+----------------

Please note that I do NOT want to force the browser into a particular rendering, just to suggest something - or to be told that it is not possible.

Any solution must work in MS IE 7.


Solution

  • I guess the best you can do is giving a width to the chosen th

    here some example code: http://jsfiddle.net/karameloso/aMTNH/