Suhail Gupta
Suhail Gupta

Reputation: 23276

Keeping text at center bottom in a cell of table

I want to place text at center and at the bottom of the cell in table. How can I do this?

This is what I want:

enter image description here

Upvotes: 21

Views: 65199

Answers (3)

Prerita Verma
Prerita Verma

Reputation: 21

table, th, td {
	  border: 1px solid black;
	  border-collapse: collapse;
}
td{
  vertical-align:bottom;
  text-align:center;
  }
<table>
  <tr>
    <td rowspan="3" width="100%">bottom and center</td>
   </tr>
   <tr>
    <td rowspan="1">TOTAL</td>
   </tr>
   <tr>
    <td rowspan="1">TOTAL</td>
   </tr>
</table>

					    	

use style vertical-align:bottom;text-align:center; these can be helpful for your table.

Upvotes: 2

sym3tri
sym3tri

Reputation: 3823

valign="bottom" might work.

http://www.w3schools.com/tags/att_td_valign.asp

But I think that's deprecated.

So you should do it in CSS with:

<td style="vertical-align:bottom;">your text</td>

Upvotes: 3

MikeM
MikeM

Reputation: 27415

CSS:

td {vertical-align:bottom;text-align:center;}

example: http://jsfiddle.net/vKPG8/

Upvotes: 52

Related Questions