לאתר זה תהיה פונקציונליות מוגבלת בזמן שאנו מתחזקים אותו לשיפור החוויה שלך. אם מאמר מסויים לא פותר את הבעיה שלך וברצונך לשאול שאלה, קהילת התמיכה שלנו מחכה לעזור לך ב־Twitter תחת ‎@FirefoxSupport וב־Reddit תחת ‎/r/firefox.

חיפוש בתמיכה

יש להימנע מהונאות תמיכה. לעולם לא נבקש ממך להתקשר או לשלוח הודעת טקסט למספר טלפון או לשתף מידע אישי. נא לדווח על כל פעילות חשודה באמצעות באפשרות ״דיווח על שימוש לרעה״.

מידע נוסף

Problem with HTML code in a message

  • 4 תגובות
  • 6 have this problem
  • 1 view
  • תגובה אחרונה מאת MiguelTeleco

more options

Hi everyone,

i'm trying to send an HTML table in a email using python, but everything is okey with that (i said it just to give info). This is the text of an example email i send with python (printed just before to be sent):

TABLE

COLUMN1COLUMN2
DATA1<a href=webexample.com>DATA2</a>
</br>

Everything is okey but, when i read with Thunderbird some emails with tables, this tables are corrupted BY A WHITESPACE that wasn't at first in the html email code. As i seen, it happens when some tag like <td> is at the end of a html line and Thunderbird write the first half of the tag in one line and A WHITESPACE WITH THE OTHER HALF PART in the other line. Here is an example from the font code of an email in Thunderbird:

TABLE

<
COLUMN1COLUMN2
DATA1
Hi everyone, i'm trying to send an HTML table in a email using python, but everything is okey with that (i said it just to give info). This is the text of an example email i send with python (printed just before to be sent): <h1>TABLE</h1><table border="1"><tr><th>COLUMN1</th><th>COLUMN2</th></tr><tr><td>DATA1</td><td><a href=webexample.com>DATA2</a></td></table></br> Everything is okey but, when i read with Thunderbird some emails with tables, this tables are corrupted BY A WHITESPACE that wasn't at first in the html email code. As i seen, it happens when some tag like <td> is at the end of a html line and Thunderbird write the first half of the tag in one line and A WHITESPACE WITH THE OTHER HALF PART in the other line. Here is an example from the font code of an email in Thunderbird: <h1>TABLE</h1><table border="1"><tr><th>COLUMN1</th><th>COLUMN2</th></tr><tr><td>DATA1</td>< td><a href=webexample.com>DATA2</a></td></table></br> As you can see, there is a whitespace at the start of the second line, corrupting the row of the table. Why this happen?

כל התגובות (4)

more options

Okey this webpage have interpreted the html code i posted. I add an image with the code:

more options

You have <th>COLUMN2</th1>

(That is IMHO a hideously unreadable font…)

I use &lt; to generate a < character that the forum engine won't parse. Occasionally a leading space or the <code>…</code> and <pre>…</pre> tags work.

Note that a line with a leading space is formatted as if code.

But even with all these I think you still need to escape the '<'. :-(

השתנתה ב־ על־ידי Zenos

more options

I wonder if you might avoid some problems by wrapping your lines, thus:

<table border="1">
  <tr><th>COLUMN1</th><th>COLUMN2</th></tr>
  <tr><td>DATA1</td><td>DATA2</td></tr>
</table>
more options

Thank you! I think i will coding your second solution, it is just parsing the lines, bored but it will work.