So i've been trying to automate emails sent via autocrat on google sheets, the problem is, the tables of my html email keeps breaking no matter what i do. it seems to be creating random TR'S and br tags that are breaking my tables see the result email broken
<table style="margin-top: 1px; border-collapse:collapse; width:600px;">
<tr>
<td style="width:400px; text-align: center; vertical-align: middle; border: 1px solid #000000; padding:0; background-color:#dddddd;">
<p style="font-family:Calibri; font-size:11pt;"><b><span style="font-family:'Times New Roman';">MEMORANDO</span></b></p>
</td>
<td style="width:200px; border: 1px solid #000000; text-align:center; vertical-align:middle;">
<p style="font-family:Calibri; font-size:11pt; text-align:center;"><b><span style="font-family:'Times New Roman'; ">Nº 383/2025.</span></b></p>
</td>
</tr>
</table>
<table style="border-collapse:collapse; width:600px;">
<tr>
<td style="width:150px; text-align: center; vertical-align: middle; border: 1px solid #000000; padding:0; background-color:#dddddd;">
<p style="font-size:12pt"><b><span style="font-family:'Times New Roman'; ">ORIGEM</span></b></p>
</td>
<td style="width:450px; border: 1px solid #000000; padding:0; vertical-align:middle;">
<p style="text-align:center; font-size:12pt"><span style="font-family:'Times New Roman'">Coordenação de Assessoramento Técnico-Científico do Convênio nº 01/2024-MPAP/UNIFAP/FUNDAPE-AC.</span></p>
</td>
</tr>
</table>
<table style="border-collapse:collapse; width:600px;">
<tr>
<td style="width:150px; text-align: center; vertical-align: middle; border: 1px solid #000000; padding:0; background-color:#dddddd;">
<p style="font-size:12pt"><b><span style="font-family:'Times New Roman'; ">DESTINO</span></b></p>
</td>
<td style="width:450px; border: 1px solid #000000; padding:0; vertical-align:middle; background-color:#dddddd;">
<p style="text-align:center; font-size:12pt"><b><span style="font-family:'Times New Roman'; ">Gerência da Divisão de Assessoramento Técnico do Núcleo de Apoio Técnico e Administrativo (NATA) do Ministério Público do Estado do Amapá (MP-AP).</span></b></p>
</td>
</tr>
</table>
<table style="border-collapse:collapse; width:600px;">
<tr>
<td style="width:150px; text-align: center; vertical-align: middle; border: 1px solid #000000; padding:0; background-color:#dddddd;">
<p style="font-size:12pt"><b><span style="font-family:'Times New Roman'; ">RESPONSÁVEL</span></b></p>
</td>
<td style="width:450px; border: 1px solid #000000; padding:0; vertical-align:middle; background-color:#dddddd;">
<p style="text-align:center; font-size:12pt"><b><span style="font-family:'Times New Roman'; ">Doutora Carla Adriana Schneider Sebastiani.</span></b></p>
</td>
</tr>
</table>
<table style="border-collapse:collapse; width:600px;">
<tr>
<td style="width:150px; text-align: center; vertical-align: middle; border: 1px solid #000000; padding:0; background-color:#dddddd;">
<p style="font-size:12pt"><b><span style="font-family:'Times New Roman'; ">ASSUNTO</span></b></p>
</td>
<td style="width:450px; border: 1px solid #000000; padding:0; vertical-align:middle;">
<p class="NoSpacing0" style="text-align:center; font-size:12pt">
Encaminhamento de indicação do (a) <em>expert</em> bolsista pesquisador (a) <b>ADENILSON COSTA DE OLIVEIRA</b>, da <em>expertise</em> epistemológica de <b>ENGENHARIA CIVIL</b>, para concessão de Autorização de Emissão de Portaria de Designação no Projeto de Pesquisa Científica “<b><span style="background-color:#ffffff">Análise de obras de pavimentação e de drenagem, situadas na Rua da Piçarreira, no bairro Elesbão, e vias adjacentes, informados no Processo Extrajudicial Eletrônico (PEE) nº 0002276-26.2023.9.04.0002</span></b>”, referente à Solicitação de Apoio Técnico (SAT) nº <b>1142</b>, da <b>Promotoria de Justiça de Defesa do Meio Ambiente, Conflitos Agrários, Habitação e Urbanismo da Comarca de Santana-AP (PJMAHU/STN)</b><b><span style="color:#1f1f1f; background-color:#ffffff"> do MP-AP</span></b>, conforme fontes secundárias de informação do Procedimento de Gestão Administrativa (PGA) nº <b>20.06.0002.0000774/2025-75, do </b>Processo Extrajudicial Eletrônico (PEE) nº <b><span style="background-color:#ffffff">0002276-26.2023.9.04.0002</span></b>, e da Solicitação de Apoio Técnico (SAT) nº <b>1142</b> do Sistema <em>Expert</em> do Núcleo de Apoio Técnico Administrativo (NATA) do MP-AP.
</p>
</td>
</tr>
</table>
<table style="border-collapse:collapse; width:600px;">
<tr>
<td style="width:150px; text-align: center; vertical-align: middle; border: 1px solid #000000; padding:0; background-color:#dddddd;">
<p style="font-size:12pt"><b><span style="font-family:'Times New Roman'; ">DATA</span></b></p>
</td>
<td style="width:450px; border: 1px solid #000000; padding:0; vertical-align:middle;">
<p style="text-align:center; font-size:12pt"><b><span style="font-family:'Times New Roman'; ">17 de julho de 2025.</span></b></p>
</td>
</tr>
</table>
this is what is suposed to look like see the html code run by an html editor
it's suposed to be just tables with no space between them and neither space up or down, when i run the html code in a html editor, it looks clean and right, on outlook email mobile it looks a lot cleaner too, but with the spaces between tables. all a i want is for the tables to be together.
Here's the code snippet https://gist.github.com/lobat00/f6e48975d6d516da606a5c4862397d08
I think you may try a few things:
Add cellspacing="0" cellpadding="0"
to your tables and use margin: 0; padding: 0;
on all elements
Try using display: block
on your table elements to prevent email clients from adding default spacing
Check if Autocrat is adding line breaks when processing the HTML - sometimes automation tools insert extra whitespace
The random <br>
and <tr>
tags suggest the email client is trying to "fix" what it thinks is malformed HTML. You might also want to test sending a simple version first to see if the issue is with the HTML structure or the automation tool itself. Hope this may do some help.
btw, what email client are you testing with? Gmail tends to be more aggressive about modifying HTML than Outlook.