Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

Problem with HTML code in a message

  • 4 답장
  • 6 이 문제를 만남
  • 1 보기
  • 최종 답변자: 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.