Display results centered on a table

0

I want to display the data by a ng-repeat in a table, it puts the correct data but always to the left of the table cell, I already tried to add <td valign="middle"> but without success.

<table class="table table-bordered">
                <tr>
                    <th>Dia</th>
                    <th>Mes</th>
                    <th>Ano</th>
                    <th>Media</th>
                </tr>
                <tr ng-repeat="result in jsonResult">
                    <td valign="middle">{{result.Dia}}</td>
                    <td valign="middle">{{result.Mes}}</td>
                    <td valign="middle">{{result.Ano}}</td>
                    <td valign="middle">{{result.Media}}</td>
                </tr>
            </table>
    
asked by anonymous 20.10.2015 / 12:52

1 answer

1

Only include style:

td {height: 50px; width: 50px;}

td {height: 50px; width:50px;}

#cssTable td {text-align:center; vertical-align:middle;}
<table border="1">
    <tr>
        <td align="center" valign="middle">Text</td>
        <td align="center" valign="middle">Text</td>
    </tr>
</table>

<table border="1" id="cssTable">
    <tr>
        <td>Text</td>
        <td>Text</td>
    </tr>
</table>
    
20.10.2015 / 12:55