0

I need to make table td so it cannot enlarge. It should be square and height fixed and if there is more text then can contain a box it should stay as is and the text just go down. Hot to do that?

Oleksandr IY
  • 2,467
  • 5
  • 30
  • 51

5 Answers5

1

See Set the table column width constant regardless of the amount of text in its cells?

table-layout: fixed;

Here is a jsfiddle that has some HTML changes as well as CSS changes: http://jsfiddle.net/GR4Lm/

I removed some rows to simplify things, but the same technique would apply--wrap all TD contents in a single DIV.

Community
  • 1
  • 1
Shawn
  • 7,449
  • 3
  • 29
  • 55
0

Add a DIV in each TD and add overflow:hidden for that element's style and give it fixed dimensions.

Diodeus - James MacFarlane
  • 110,221
  • 32
  • 151
  • 174
0
    td style="height:xpx; width:xpx; overflow:auto;"
fwho
  • 248
  • 2
  • 14
0

Assuming I understand your question correctly, use max-height and max-width in your CSS.

GiantDuck
  • 1,076
  • 3
  • 13
  • 27
0

I think may do what you're looking for: http://jsfiddle.net/rVDQm/

table tr td {
 width:400px;
 height:400px;
 background:#ccc;
 overflow:scroll;
 overflow-x:hidden;
 display:block;
}
Billy Moat
  • 20,300
  • 7
  • 43
  • 37