Loading Please Wait...
To specify text alignment inside table in CSS, use the text-align (horizontally) and vertical-align (vertically) property.
We can set the alignment of the table head <th>, table data <td>
Use CSS text-align property to horizontally align the text.
We can align text to left, center, right or justify.
th, td{
text-align: left;
}
Use CSS vertical-align property to vertically align the text.
We can align text to top, middle, bottom or baseline.
th, td{
vertical-align: top;
}
As we know that text inside a table is place inside a box. So we can align table text to 9 different places.
/* top-left */
th, td{
text-align: left;
vertical-align: top;
}
/* top-center*/
th, td{
text-align: center;
vertical-align: top;
}
/* top-right*/
th, td{
text-align: right;
vertical-align: top;
}
/* middle-left */
th, td{
text-align: left;
vertical-align: middle;
}
/* middle-center*/
th, td{
text-align: center;
vertical-align: middle;
}
/* middle-right*/
th, td{
text-align: right;
vertical-align: middle;
}
/* bottom-left */
th, td{
text-align: left;
vertical-align: bottom;
}
/* bottom-center*/
th, td{
text-align: center;
vertical-align: bottom;
}
/* bottom-right*/
th, td{
text-align: right;
vertical-align: bottom;
}
How you feel about this blog:
Share this blog on:
If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com
Contact UsWe are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..
Copyright ©
, Lynxsia IT Solutions, All rights reserved