Reputation: 137
I have little problem positioning text in the middle of table row.
Each table row contains three <td>
elements. I want to position text in the middle of the cell. Now 'Name' text where 'Description' is longer is in top.
I tired
td {
vertical-align: middle;
}
but that doesn't work. How to correctly position text?
UPDATE
This worked fine:
.table tbody>tr>td.vert-align{
vertical-align: middle;
}
Upvotes: 2
Views: 1751
Reputation: 113
Another great option that I find the most compliant is using the line-height property to vertically align/center single line text
td {
line-height: 100px; /*play around with this value*/
}
Upvotes: 2