Greggo
Greggo

Reputation: 79

Nesting a <table> within a <table> html email

I'm at a total loss here. I want to nest multiple tables within a centered table for an html email and both firebug and the W3C validator are telling me I have more opening table tags than closing table tags. A test in firebug shows the containing table as before the nested tables, not surrounding them.

If I change the containing <table> to a <div>, all the issues go away. No idea what is wrong.

Here is the html email in question: http://coastmusic.com/optiweb/

Upvotes: 1

Views: 4872

Answers (2)

gj-wes
gj-wes

Reputation: 932

You currently have this for the container table:

<table width="600" cellpadding="0" cellspacing="0" align="center">
  <table width="600" cellpadding="0" cellspacing="0" align="center">

You'll need to add tr and td tags after your container table

<table width="600" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td>
      <table width="600" cellpadding="0" cellspacing="0" align="center">

Also add the appropriate closing tags too.

Upvotes: 6

Bidstrup
Bidstrup

Reputation: 1617

I cleaned up your code.. As Gwesolo says, you need some tr and td's around your tables.

<!DOCTYPE html>
<html>
<head>
<title>Elixir OPTIWEB Coating</title>
</head>
<body bgcolor="#E9EAEA">
<table width="100%" cellpadding="0" cellspacing="0" align="center">
<tr>
    <td width="100%" align="center">
    <table width="600" cellpadding="0" cellspacing="0" align="center">
    <tr>
        <td><img src="assets/header.jpg" />
        </td>
    </tr>
    <tr>
        <td align="center"><img src="assets/packaging-eyecandy.jpg" />
        </td>

    </tr>
    <tr>
        <td style="background-color: #282727; color: #FFF;">
            <h1 style="font-size: 18px; font-family: sans-serif; margin-bottom: 0; padding: 5px 5px 0 5px;">INTRODUCING OPTIWEB&trade; COATING</h1>

            <p style="font-size: 12px; font-family: sans-serif; padding: 0 5px 5px 5px; margin-top: 5px;">Elixir&reg; OPTIWEB Coated Electric Guitar Strings feature a crisp tone that sounds indistinguishable from uncoated strings and a more natural familiar feel than both NANOWEB&reg; and POLYWEB&reg; Coated Strings without sacrificing the extended tone life that players have come to expect from Elixir Strings.</p>

        </td>
    </tr>
</table>
<!--2 column-->
<table width="600" cellpadding="0" cellspacing="0" style="background-color: #FFF; padding-bottom: 20px;" align="center">
    <tr>
        <td><img style="margin-top: 10px;" src="assets/string-closeup.jpg" />
        </td>

        <td>
            <h2 style="font-size: 14px; font-family: sans-serif; margin-top: 5px; margin-bottom: 0; padding-left: 10px; padding-right: 10px;">Unlike other string brands, Elixir Strings coats the whole string</h2>

            <p style="font-size: 12px; font-family: sans-serif; margin-top: 5px; margin-bottom: 5px; padding-left: 10px; padding-right: 10px;">The NANOWEB, POLYWEB and OPTIWEB Coatings not only protect the outer string surface, but also the gaps between the windings where tone-deadening debris typically builds up in other brands' coated and uncoated guitar strings. Anti-Rust Plating on plain steel strings ensures longer tone life for the entire set.</p>

            <a target="_blank" style="display: block;" href="https://www.youtube.com/watch?v=OC6DegDso2Y"><img src="assets/yt-link.jpg" />
            </a>

        </td>
    </tr>
</table>
<!--1 column-->
<table width="600" cellpadding="0" cellspacing="0" style="background-color: #FFF;" align="center">
    <tr>
        <td align="center">
            <hr style="margin: 5px;" />
            <h2 style="font-size: 18px; font-family: sans-serif; margin-bottom: 0; margin-top: 5px; padding-left: 10px; padding-right: 10px;">The range to meet the playing style of every electric guitarist</h2>

            <p style="font-size: 12px; font-family: sans-serif; margin-top: 5px; padding-left: 10px; padding-right: 10px;">With the introduction of OPTIWEB Coating, Elixir Strings satisfies player demands.</p>
        </td>
    </tr>
    <tr>
        <td align="center">
            <img src="assets/chart.jpg" />
        </td>
    </tr>
    <tr>
        <td align="center">
            <img src="assets/ab-chart.jpg" />
        </td>
    </tr>
    <tr>
        <td>
            <h2 style="font-size: 14px; font-family: sans-serif; padding-left: 10px; padding-right: 10px; margin-bottom: 5px;">Musicians can't hear the difference between OPTIWEB Coated and uncoated strings</h2>

            <p style="font-size: 12px; font-family: sans-serif; padding-left: 10px; padding-right: 10px;  margin-top: 0;">Uncoated and coated players alike confirm that OPTIWEB Coated Electric Strings have the same tone as uncoated strings.* Hear for yourself with our A/B sound test that compares OPTIWEB Coated Electric Strings with uncoated strings!

                <span>*Elixir Strings electric tone and feel field trials</span>
            </p>
        </td>
    </tr>
    <tr>
        <td align="center">
            <a target="_blank" style="display: block;" href="http://www.elixirstrings.com/experience/"><img style="margin: 10px 0;" src="assets/hear-the-difference.jpg" />
            </a>
        </td>
    </tr>
    <tr>
        <td>
            <h2 style="font-size: 14px; font-family: sans-serif; padding-left: 10px; padding-right: 10px; margin-bottom: 5px;">GEAR UP SWEEPSTAKES!</h2>

            <p style="font-size: 12px; font-family: sans-serif; padding-left: 10px; padding-right: 10px; margin-top: 0;">All OPTIWEB Coated Electric String Sets will include a game piece for a chance to win impressive weekly, monthly and grand prizes in the consumer sweepstakes. Look for specially marked packages!
                <span>*Sweepstakes is not open to residents of Quebec.</span>
            </p>
        </td>
    </tr>
    <tr>
        <td align="center">
            <img style="margin: 10px 0;" src="assets/learn-more.jpg" />
        </td>
    </tr>
    <tr style="background-color: #282727; height: 30px;">
        <td align="center">
            <img style="margin-top: 5px;" src="assets/coast-logo.jpg" />
        </td>
    </tr>
    <tr style="background-color: #282727; color: #FFF;">
        <td>
            <p style="font-size: 12px; font-family: sans-serif; text-align: center; margin-top: 5px; margin-bottom: 10px;">Copyright &copy; 2017 Coast Music, All rights reserved.
                <br /> Our mailing address is: Coast Music 21000 Trans-Canadienne Baie-d'urfe, Qc H9X 4B7 Canada</p>

        </td>
    </tr>
</table>
</td>
</tr>
</table>
</body>
</html>

Upvotes: 0

Related Questions