Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 992
Suhail Gupta Avatar asked Apr 27 '11 15:04

Suhail Gupta


3 Answers

CSS:

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

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

like image 167
MikeM Avatar answered Oct 22 '22 17:10

MikeM


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>
like image 30
sym3tri Avatar answered Oct 22 '22 17:10

sym3tri


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.

like image 39
Prerita Verma Avatar answered Oct 22 '22 16:10

Prerita Verma