Present results centered on a table

Asked

Viewed 49 times

0

I want to present the data through a ng-repeat in a table, it puts the correct data but always to the left of the table cell, I 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>

1 answer

1


Only include the 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>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.