You are viewing limited content. For full access, please sign in.

Question

Question

HTML Table in Forms Email

asked on August 19, 2016

I want to use an html table in the Forms email but it currently isn't working.

Current Email in Forms:

 

Truck Required? {/dataset/Truck_Required_}
Service Required? {/dataset/Service_Required_}

<style type="text/css">
.tg  {border-collapse:collapse;border-spacing:0;border-color:#aaa;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#aaa;color:#333;background-color:#fff;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#aaa;color:#fff;background-color:#f38630;}
.tg .tg-yw4l{vertical-align:top}
</style>
<table class="tg">
  <tr>
    <th class="tg-yw4l">Department</th>
    <th class="tg-yw4l">Old</th>
    <th class="tg-yw4l">New</th>
  </tr>
  <tr>
    <td class="tg-yw4l">Location + Room</td>
    <td class="tg-yw4l">{/dataset/Location_Room_Old}</td>
    <td class="tg-yw4l">{/dataset/Location_Room_New}</td>
  </tr>
  <tr>
    <td class="tg-yw4l">GL String</td>
    <td class="tg-yw4l">{/dataset/GL_String_Old}</td>
    <td class="tg-yw4l">{/dataset/GL_String_New}</td>
  </tr>
  <tr>
    <td class="tg-yw4l">Queue Name</td>
    <td class="tg-yw4l">{/dataset/Queue_Name_Old}</td>
    <td class="tg-yw4l">{/dataset/Queue_Name_New}</td>
  </tr>
  <tr>
    <td class="tg-yw4l">IP Address</td>
    <td class="tg-yw4l">{/dataset/IP_Address_Old}</td>
    <td class="tg-yw4l">{/dataset/IP_Address_New}</td>
  </tr>
  <tr>
    <td class="tg-yw4l">Port #</td>
    <td class="tg-yw4l">{/dataset/Port_Num_Old}</td>
    <td class="tg-yw4l">{/dataset/Port_Num_New}</td>
  </tr>
  <tr>
    <td class="tg-yw4l">Fax #</td>
    <td class="tg-yw4l">{/dataset/Key_OP_Old}</td>
    <td class="tg-yw4l">{/dataset/Fax_Num_New}</td>
  </tr>
  <tr>
    <td class="tg-yw4l">Key OP</td>
    <td class="tg-yw4l">{/dataset/Key_OP_Old}</td>
    <td class="tg-yw4l">{/dataset/Key_OP_New}</td>
  </tr>
  <tr>
    <td class="tg-yw4l">Fax Delivery</td>
    <td class="tg-yw4l">{/dataset/fax_derliver_old}</td>
    <td class="tg-yw4l">{/dataset/fax_derlivery_new}</td>
  </tr>
</table>

          Folder Old: {/dataset/Fax_Delivery_Old_Folder}
          Folder New: {/dataset/Fax_Delivery_New_Folder}
          Email Old: {/dataset/Fax_Delivery_Old_Email}
          Email New: {/dataset/Fax_Delivery_New_Email}

Are you able to attach HTML into the body as such or do you need to set something more?

0 0

Answer

SELECTED ANSWER
replied on August 23, 2016 Show version history

You wouldn't want to wrap <tbody></tbody> around the table, it'll be something like <table><tbody>...</tbody></table>.

Could you attach a screenshot of what you see in both the editor and the rendered form? And if you're seeing the HTML code, I have to ask...are you entering the HTML code in the HTML tab, or in the Rich Text Editor tab?

Lastly, is this the only custom HTML field on the form? If not, and especially if there is one preceding it somewhere, double-check the code in that field to make sure there aren't any missing closing tags.

1 0

Replies

replied on August 19, 2016

Hi Chase,

I haven't had issues using HTML tables in an e-mail task. What exactly is the behavior you are seeing? Is there no table at all? The only substantive difference I can tell between mine and yours is that mine has <tbody>...</tbody> tags added around everything between the <table>...</table> tags.

Also if you remove the CSS in the style tags, does the behavior change at all? I haven't tried all of the CSS rules which you have configured, it's possible that one of those is causing weirdness.

0 0
replied on August 19, 2016

What you posted isn't valid HTML. Your table is missing the tbody tags.

0 0
replied on August 22, 2016

I noticed that Forms would add the tbody tags, at least for me, as I don't usually include those in the first place, anyway. In any case, while in HTML5 it is considered "correct" to include them, no functionality is lost by their omission, consider for example the Mozilla Developer Network reference.

0 0
replied on August 22, 2016

Web browsers don't care, but email clients are a lot more strict about HTML syntax. Your mileage may vary. wink

0 0
replied on August 23, 2016

I removed the Style tags and just left the table with adding the <tbody> </tbody> wrapped around the Table with the same behavior as well.  Still just showing the HTML code.

0 0
SELECTED ANSWER
replied on August 23, 2016 Show version history

You wouldn't want to wrap <tbody></tbody> around the table, it'll be something like <table><tbody>...</tbody></table>.

Could you attach a screenshot of what you see in both the editor and the rendered form? And if you're seeing the HTML code, I have to ask...are you entering the HTML code in the HTML tab, or in the Rich Text Editor tab?

Lastly, is this the only custom HTML field on the form? If not, and especially if there is one preceding it somewhere, double-check the code in that field to make sure there aren't any missing closing tags.

1 0
replied on August 23, 2016

Yeah I flipped them just before you posted this and it looks like it worked.  I was just missing the body.

0 0
replied on August 23, 2016

I'll do some experimentation with that...like I'd said earlier, I usually don't include the <tbody> tags but Forms seemed to add them for me. Unless I just completely blanked on what I was doing at the time.

In any case, glad to hear it's working now!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.