Search code examples
htmlnested-table

Aligning td in nested table


Hi working to create a newsletter template. At the moment I am stuck as i am unable to change the alignment of the td

I have attached a CodePen, but below is the code! Firstly I don't understand why the elements on the right are aligned left-center? Eitherway I need them to be top-center. Any ideas?

<table align="center" width="690px" bgcolor="#d3e1a3" border="1">
  <tr>
    <td>
      <table width="297px" height="100%">
        <tr>
          <td>
            <img src="https://www.naturimgarten.at/assets/images/4/Streicher-ff65c810.jpg" style="max-width:297px;" alt="placeholder" mc:edit="image">
          </td>
        </tr>
      </table>
    </td>
    <td>
      <table width="393px" align="center">
        <tr>
          <td>
            name
          </td>
        </tr>
        <tr>
          <td>
            country
          </td>
        </tr>
        <tr>
          <td>text</td>
        </tr>
      </table>
    </td>
  </tr>
</table>

Mind you this is for a newsletter template so think web 1998, most of the fancy web stuff is not usefull here!


Solution

  • You have put align="center" in the td tag.

    <table align="center" width="690px" bgcolor="#d3e1a3" border="1">
      <tr>
        <td>
          <table width="297px" height="100%">
            <tr>
              <td align="center" >
                <img src="https://www.naturimgarten.at/assets/images/4/Streicher-ff65c810.jpg" style="max-width:297px;" alt="placeholder" mc:edit="image">
              </td>
            </tr>
          </table>
        </td>
        <td style="vertical-align:top;">
          <table width="393px" align="center">
            <tr>
              <td align="center" >
                name
              </td>
            </tr>
            <tr>
              <td align="center" >
                country
              </td>
            </tr>
            <tr>
              <td align="center" >text</td>
            </tr>
          </table>
        </td>
      </tr>
    </table>