Robin Agrahari
Robin Agrahari

Reputation: 817

table size problem

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 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???

Upvotes: 0

Views: 308

Answers (3)

dmazzoni
dmazzoni

Reputation: 13236

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.

Upvotes: 0

Jonny Haynes
Jonny Haynes

Reputation: 3186

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.

Upvotes: 2

Tommy
Tommy

Reputation: 1985

try this css

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

Upvotes: 4

Related Questions