开发者

table size problem

开发者 https://www.devze.com 2022-12-15 14:55 出处:网络
sir when i inse开发者_JAVA百科rt a long string data the table size comes out of the page as show below.

sir when i inse开发者_JAVA百科rt 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???


try this css

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


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.


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.
0

精彩评论

暂无评论...
验证码 换一张
取 消