FOR BOOTSTRAP 3.X:
Bootstrap now has the following style for table cells:
.table tbody > tr > td{ vertical-align: top; }
The way to add your own class is by adding more specifics to the previous selector:
.table tbody > tr > td.vert-aligned { vertical-align: middle; }
Then add the class to td s:
<tr> <td class="vert-aligned"></td> ... </tr>
FOR BOOTSTRAP 2.X
There is no way to do this with Bootstrap.
When used in table cells, vertical-align does what most people expect to simulate the (old, obsolete) valign attribute. In a modern standards-compliant browser, the following three code snippets do the same thing:
<td valign="middle"> </td> <td style="vertical-align:middle"> ... </td> <div style="display:table-cell; vertical-align:middle"> ... </div>
Refresh the fiddle
Further
In addition, you cannot reference the td class using .vert , because Bootstrap already has this class:
.table td { padding: 8px; line-height: 20px; text-align: left; vertical-align: top;
And it overloads vertical-align: middle in the .vert class, so you should define this class as td.vert .
Tom Sarduy Dec 07 2018-12-12T00: 00Z
source share