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?
Asked
Active
Viewed 162 times
5 Answers
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.
0
Add a DIV in each TD and add overflow:hidden
for that element's style and give it fixed dimensions.

Diodeus - James MacFarlane
- 112,730
- 33
- 157
- 176
0
Assuming I understand your question correctly, use max-height
and max-width
in your CSS.

GiantDuck
- 1,086
- 3
- 14
- 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,792
- 7
- 45
- 37