tags:

views:

57

answers:

3

sir when i insert a long string data the table size comes out of the page as show below.

http://lh3.ggpht.com/_Um0yFxPtzJ8/S0G8dGp1EcI/AAAAAAAAACc/JOJGrM0U-dI/s800/untitled.JPG

should i userd table-layout:fixed;word-wrap:break-word; as:

table { border-width:1 px; background-color: #ffffff; border-right-color: #828DAF; border-bottom-color: #828DAF; border-top-color:#828DAF; border-left-color: #828DAF; table-layout:fixed; word-wrap:break-word; }

but its nt working???

+4  A: 

try this css

table-layout:fixed;word-wrap:break-word;

Tommy
should i write it here?table { border-width:1 px; background-color: #ffffff; border-right-color: #828DAF; border-bottom-color: #828DAF; border-top-color:#828DAF; border-left-color: #828DAF; table-layout:fixed; word-wrap:break-word;}coz its nt working???
Robin Agrahari
table-layout belongs to tableword-wrap:break-word;overflow:hidden; belongs to the td or any wrapper u put into the table cell.
Tommy
sorry its not working
Robin Agrahari
+2  A: 

My suggestion would be to reduce your font size or add a div around your table and add overflow: auto; to it ... so an horizontal scroll bar appears when you have too much content in your table.

Jonny Haynes
A: 

As Tommy said, you want to use "table-layout: fixed" in the CSS for your table.

Then you have at least three choices for what to do with table cells that have too much content:

  1. Do nothing - they'll keep going outside their cell.
  2. word-wrap:break-word will break in the middle of a word
  3. overflow:hidden (on the TD, not the TABLE) will cause the rest of the text to be hidden; the user can expose more by making the window wider or decreasing the font size.
dmazzoni