2
How do I align the content of <td>
inside my table?
I know that to align horizontally I use text-align: center; //text-aling está errado
.
I want it to look like Teste
and Armas
.
<table class="table table-striped table-bordered table-hover" id="">
<thead>
<tr>
<th>Icone</th>
<th>Nome</th>
<th>Categoria</th>
<th>Tipo</th>
<th>Level</th>
<th>Preço</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;"><img src=""></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"></td>
</tr>
</tbody>
</table>
It wasn’t, it’s still the same as the picture.
– Everton Figueiredo
can you send the html of this table? you want it to be centered horizontally and vertically?
– Zorkind
Try using the attribute valign=Middle then as shown here https://www.w3schools.com/tags/att_td_valign.asp
– Zorkind
Changed question and put html.
– Everton Figueiredo
Missing <tr> in this table
– Zorkind
forgot to type
– Everton Figueiredo
tried to use the attribute valign?
– Zorkind
Yes it’s still the same.
– Everton Figueiredo
Which result do you expect from this table, I still haven’t quite figured out what you want.
– Zorkind
OK got it, just put ! Mportant in front
– Zorkind
I edited the question to improve understanding.
– Everton Figueiredo
How so put ! Mportant in front?
– Everton Figueiredo
added the code in a reply :-)
– Zorkind
Now I understood why I needed to put the ! Mportant?
– Everton Figueiredo
Because we’re modifying Bootstrap’s behavior, the ! Important makes you force the style closest to the element to be the style considered by the browser.
– Zorkind
I understand now I had no idea that I had this kind of priority. Thank you.
– Everton Figueiredo
It’s not a good practice though! just solves your problem, but that’s not the best way, okay? the right is to check where is being forced this alignment at the top and try to make adjustments in this class or maybe make an "override" of this class.
– Zorkind