How to align content in td?

2

How do I align the contents of <td> within my table?

I know that for horizontal alignment I use text-align: center; //text-aling está errado .

I want it to be equal to 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>

    
asked by anonymous 07.12.2017 / 23:04

3 answers

2

Ok, below is the code:

<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="https://www.google.com.br/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"></td><tdstyle="text-align: center; vertical-align:middle !important">teste</td>
             <td style="text-align: center; vertical-align:middle !important">teste</td>
             <td style="text-align: center; vertical-align:middle !important">teste</td>
             <td style="text-align: center; vertical-align:middle !important">teste</td>
             <td style="text-align: center; vertical-align:middle !important"></td>
             </tr>
     </tbody>
</table>
    
07.12.2017 / 23:32
1

The good thing about tables is that you can align vertically quite easily.

Just use vertical-align: middle

    
07.12.2017 / 23:10
0

Make a style for this type table

    table tr{
       text-align: center;
    }
    
07.12.2017 / 23:09