Open links in new tab
    • Work Report
    • Email
    • Rewrite
    • Speech
    • Title Generator
    • Smart Reply
    • Poem
    • Essay
    • Joke
    • Instagram Post
    • X Post
    • Facebook Post
    • Story
    • Cover Letter
    • Resume
    • Job Description
    • Recommendation Letter
    • Resignation Letter
    • Invitation Letter
    • Greeting Message
    • Try more templates
  1. The text-align property in CSS is used to set the horizontal alignment of content inside <td> elements. By default, text in <td> is left-aligned. You can use text-align to align text to the left, center, or right.

    Example: Center Align Text in <td>

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <style>
    td {
    text-align: center; /* Centers the text horizontally */
    }
    </style>
    </head>
    <body>
    <table border="1">
    <tr>
    <td>Row 1, Col 1</td>
    <td>Row 1, Col 2</td>
    </tr>
    <tr>
    <td>Row 2, Col 1</td>
    <td>Row 2, Col 2</td>
    </tr>
    </table>
    </body>
    </html>
    Copied!

    Vertical Alignment

    To control vertical alignment, use the vertical-align property. By default, content is vertically aligned to the middle.

    Example: Bottom Align Text in <td>

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <style>
    td {
    height: 50px; /* Set height for better visibility */
    vertical-align: bottom; /* Aligns text to the bottom */
    }
    </style>
    </head>
    <body>
    <table border="1">
    <tr>
    <td>Bottom Aligned</td>
    <td>Bottom Aligned</td>
    </tr>
    </table>
    </body>
    </html>
    Copied!

    Important Notes

    Feedback
    1. html - How to align td elements in center - Stack Overflow

      May 21, 2012 · <td align="center">, align is not supported by html5, use css for solving this problem.

    2. CSS Table Alignment - W3Schools

      The CSS vertical-align property sets the vertical alignment (like top, bottom, or middle) of the content in <th> or <td>. Note: By default, the vertical alignment of the content in a table is …

    3. CSS: How to Align a Table to the Center - Life in Coding

      Whether you’re creating a data-driven dashboard or a simple pricing table, making sure your table is aligned properly improves visual structure and user experience. In this post, you’ll learn …

    4. HTML <td> align Attribute - GeeksforGeeks

      Jul 12, 2025 · Whether displaying numerical values, text, or percentages—such as 85% for progress or success rates—the <td> tag …

      Missing:
      • Center
      Must include:
    5. Center a table with CSS | Scott Granneman

      The "align" attribute has been deprecated, however, in favor of CSS (Cascading Style Sheets), and this is a good thing. However, it's not so obvious how to center a table using CSS.

    6. How to Center the Text in the HTML Table Row - W3docs

      In this snippet, we’ll demonstrate and explain examples of centering a text in the table row. For that purpose, you can use the CSS text-align property.

    7. How to Center a Table In CSS & HTML [Complete Guide]

      Jul 15, 2023 · One common challenge is centering a table horizontally and vertically within its container. In this comprehensive guide, we will walk you through the steps to achieve this using …

    8. How to Center a Table with CSS ? - GeeksforGeeks

      Jul 23, 2025 · Here are different ways to center table in CSS. 1. Center a Table using margin auto property. The CSS margin is used to set the space …

    9. CSS Layout: How To ‘Center a Div,’ the Old School Way

      3 days ago · CSS Layout: How To ‘Center a Div,’ the Old School Way After the center tag was deprecated in HTML 4.0 for architectural purity, centering content became complex and …

    10. How to Center a Table in CSS (Complete Guide) - Life in Coding

      Centering a table in CSS can be done in different ways depending on whether you want to center it horizontally, vertically, or both. In this blog, we’ll cover:

  2. People also ask