Webkit inspector is unable to tell me why my table cells are not obeying the width
style. I can get them to either stretch to fit the entire line (by setting white-space: nowrap
or to stretch to fit the longest word, but I just want the cells to be some number of pixels wide.
Asked
Active
Viewed 7,346 times
3
-
Are you trying to do anything different that [this question](http://stackoverflow.com/questions/4457506/css-how-to-set-the-table-column-width-constant-regardless-of-the-amount-of-text) ? – Hisham Oct 17 '12 at 18:17
2 Answers
4
First of all, check this out:
Now,
for fixed cell size (<td>
) use:
<col width="50px"/>
before your
<tr>
Alternatively, use:
<table width = 100>
OR
<table style="width:100px">
To fix the table size.
The "break word" value for "word wrap" property in your css is useful in these cases:
word-wrap:break-word

Community
- 1
- 1

Reut Sharabani
- 30,449
- 6
- 70
- 88