I have a table that is made up of values that are pulled from the database ....
This table has the predefined size, and it happens that when the pulled value of the bank is larger than the cell, it resizes and messes everything up ...
IwanttoknowifIcandothis:
Code
<divclass="tabela-clientes" >
<table id="mytable">
<tr>
<td style="width: 200px">
Nome
</td>
<td style="width: 200px">
Empresa
</td>
<td style="width: 90px">
Telefone
</td>
<td style="width: 180px;">
Email
</td>
<td style="width: 130px; max-width:130px;">
Opções
</td>
</tr>
......
Has anyone ever needed anything like this?
Solution formulated with the help of Diego Souza
$nome = "{$linha['nome']}";
//conta numero de caracteres da string
$tam = strlen($nome);
//se string tiver mais que 25 caracteres
if($tam > 25){
//Exibe apenas 25 caracteres
$rest = substr($nome, 0, 25);
echo $rest . "...";
}else{
echo $nome;
}