Fixed Cell Height

-1

I have a Table element in some cells I sometimes show a very large text so the cell grows in High, I had thought to put a fixed stop and show a tooltip to see all the contents of the cell. I've tried with style="table-layout: fixed", I've also put style="height: 5px;" for each, but I still do not achieve the desired effect. Attached capture.

    
asked by Emersoft 28.11.2017 в 00:34
source

1 answer

0

Good hope this helps you

The td can not be block objects that some properties do not affect them but to solve that you have to put the information inside a container in this case a p and to the properties you want

table td p{
 height: 50px;
 overflow:auto;
 background: rgb(237, 237, 237);
}
<table>
  <thead>
  <tr>
    <th>texto</th>
    <th>texto2</th>
    <th>texto3</th>
    <th>texto4</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>
    <p>
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
      </p>
    </td>
    <td>
    hola mundo
    </td>
    <td>
    hola mundo
    </td>
    <td>
    hola mundo
    </td>
  </tr>
    <tr>
    <td>
    <p>
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
      </p>
    </td>
    <td>
    hola mundo
    </td>
    <td>
    hola mundo
    </td>
    <td>
    hola mundo
    </td>
  </tr>
</tbody>
</table>
    
answered by 28.11.2017 / 00:50
source