0
I would like to fix the cell size of the table, and if the information contained exceeded this limit, a scrollbar would appear only to the specific cell, allowing the user to see all the information, but keeping the fixed size set earlier. My code is currently like this:
<table class="tabela">
<tr class="titulo">
<th>Nome</th>
<th>Sobrenome</th>
<th>Endereço</th>
<th>Tel. do familiar</th>
<th>Nome do familiar</th>
<th>Crimes cometidos</th>
<th>Duração da pena</th>
<th>Data da prisão</th>
<th>Ação</th>
</tr>
<% lista.forEach(function(user){ %>
<tr>
<th> <%= user.nome %></th>
<th> <%= user.sobrenome %> </th>
<th> <%= user.endereco %> </th>
<th> <%= user.tel_familiar %> </th>
<th> <%= user.nome_familiar %> </th>
<th> <%= user.crimes_cometidos %> </th>
<th> <%= user.duracao_pena %> </th>
<th> <%= user.dia_aprisionamento %> </th>
<th>
<form method="post">
<input type="submit" name="botao" value="Editar">
<input type="submit" name="botao" value="Excluir">
<input hidden type="text" name="id" value="<%= user.id %>">
</form>
</th>
</tr>
<% }) %>
</table>
The CSS file looks like this:
.tabela, th{
border: 3px solid black;
border-collapse: collapse;
margin:auto;
}
.tabela th{
width:5%;
}
.tabela{
max-width: 95%;
margin-top:1%;
}
.titulo{
font-size: 16px;
background-color:rgb(20, 20, 20);
color:white;
}
form input[type=submit]{
margin:5px;
}
Thanks bro! I put here in css and html and is working well.
– user127224
@atlas250 without problems man, I am happy to have helped!
– hugocsl