Table cells fixed height regardless the content of the cell

I fixed it by removing padding from table cells, and adding rule height: something.


Table cells don't overflow so you need to wrap the content in a div to use overflow

Here is an example: http://jsfiddle.net/avVQm/

HTML:

<table>
 <tr>
  <td>
   <div>
    gf asfdg fsagfag fdsa gfdsg fdsg fds g fdg
   </div>
  </td>
 </tr>
</table>

CSS:

table {
    width: 30px;
    border: 1px solid black;
}

table td > div {
    overflow: hidden;
    height: 15px;
}

Your PHP:

foreach ((array)$this->fields as $field ) {
 $wrapperdiv = NHtml::el ('div');
 $tbody_tr->add($wrapperdiv);
 $wrapperdiv->add(NHtml::el ('td')->class($field['name'])->setHtml(@$row[$field['name']]));
}

Note that I don't exactly know the syntax for the framework that you use, but I'd guess your php will look something like this.