Skip to main content

Format ASCII Tables for Emails

Ensure your ASCII tables retain their alignment and readability in emails.

When ASCII table outputs from workflows are sent via email in plain text format, their alignment may appear broken (e.g., jagged edges or uneven columns). This typically happens because email clients use proportional fonts, which disrupt the fixed spacing required for proper table formatting.

+----+----------------------+--------------------------------------+
| IDX | UPDATEDAT | WIZISSUEID |
+----+----------------------+--------------------------------------+
| 0 | 2022-03-15T01:11:30Z | 4e47bbe4-1e8b-524e-bed3-ba2ab2001785 |
+----+----------------------+--------------------------------------+
| 1 | 2022-03-15T01:11:39Z | 741ff318-f0c2-5ca3-a9fe-470ea65a4ae8 |
+----+----------------------+--------------------------------------+
| 2 | 2022-03-15T01:11:30Z | cbd41d30-37f2-5d03-8bb2-32d5649c4e1e |
+----+----------------------+--------------------------------------+
| 3 | 2022-03-17T00:49:04Z | 01b3fade-d032-5f56-847c-517f3b92a273 |
+----+----------------------+--------------------------------------+
| 4 | 2022-04-04T14:48:00Z | f8c5e9c4-aeb9-529f-ba08-b7d6ef83fee7 |
+----+----------------------+--------------------------------------+
| 5 | 2022-04-04T14:48:00Z | 5c45b22c-c413-5243-b0b6-72b2cb89e70a |
+----+----------------------+--------------------------------------+
| 6 | 2022-01-30T10:36:54Z | 957dbb2a-f196-59af-9823-a31b2d09b099 |
+----+----------------------+--------------------------------------+
| 7 | 2022-01-30T10:36:53Z | c20b1321-0536-5cc1-b88b-2adbad3d4608 |
+----+----------------------+--------------------------------------+
| 8 | 2022-03-17T00:49:04Z | 027208f1-b5a5-5de7-ba96-b336b2124296 |
+----+----------------------+--------------------------------------+
| 9 | 2022-03-09T07:33:28Z | cf66f4ac-8ab9-5aef-bec6-b013fe8105df |
+----+----------------------+--------------------------------------+
| 10 | 2022-03-09T07:33:32Z | b2c0a318-a83c-5602-9b00-9b042e574c48 |
+----+----------------------+--------------------------------------+
| 11 | 2022-03-26T14:14:41Z | c75b7253-1cde-52b0-93ba-0c9d90ce9163 |
+----+----------------------+--------------------------------------+
| 12 | 2022-04-05T21:04:10Z | 08c665be-22ea-526f-9422-c38beb554118 |
+----+----------------------+--------------------------------------+
| 13 | 2022-04-05T21:04:11Z | a0d15a8b-77da-5c7c-9a77-4ab06523c98b |
+----+----------------------+--------------------------------------+
| 14 | 2021-12-03T13:10:53Z | e3cdd8d9-46e7-52a4-9334-442f9e5f7490 |
+----+----------------------+--------------------------------------+

To preserve alignment and improve readability, apply the following adjustments:

  1. Wrap the table in HTML <pre> tags: Enclose the ASCII table output within <pre> and </pre> tags. This forces the email client to render the content using a fixed-width (monospace) font, maintaining proper alignment.

  2. Set the email content type to HTML: Configure the output content type as text/html; charset=UTF-8. This ensures the <pre> formatting is applied correctly and supports a wider range of characters.

Result:
Your ASCII table will retain its structure and display correctly in email clients, with consistent alignment and improved legibility.

+----+----------------------+--------------------------------------+
| IDX | UPDATEDAT | WIZISSUEID |
+----+----------------------+--------------------------------------+
| 0 | 2022-03-15T01:11:30Z | 4e47bbe4-1e8b-524e-bed3-ba2ab2001785 |
+----+----------------------+--------------------------------------+
| 1 | 2022-03-15T01:11:39Z | 741ff318-f0c2-5ca3-a9fe-470ea65a4ae8 |
+----+----------------------+--------------------------------------+
| 2 | 2022-03-15T01:11:30Z | cbd41d30-37f2-5d03-8bb2-32d5649c4e1e |
+----+----------------------+--------------------------------------+
| 3 | 2022-03-17T00:49:04Z | 01b3fade-d032-5f56-847c-517f3b92a273 |
+----+----------------------+--------------------------------------+
| 4 | 2022-04-04T14:48:00Z | f8c5e9c4-aeb9-529f-ba08-b7d6ef83fee7 |
+----+----------------------+--------------------------------------+
| 5 | 2022-04-04T14:48:00Z | 5c45b22c-c413-5243-b0b6-72b2cb89e70a |
+----+----------------------+--------------------------------------+
| 6 | 2022-01-30T10:36:54Z | 957dbb2a-f196-59af-9823-a31b2d09b099 |
+----+----------------------+--------------------------------------+
| 7 | 2022-01-30T10:36:53Z | c20b1321-0536-5cc1-b88b-2adbad3d4608 |
+----+----------------------+--------------------------------------+
| 8 | 2022-03-17T00:49:04Z | 027208f1-b5a5-5de7-ba96-b336b2124296 |
+----+----------------------+--------------------------------------+
| 9 | 2022-03-09T07:33:28Z | cf66f4ac-8ab9-5aef-bec6-b013fe8105df |
+----+----------------------+--------------------------------------+
| 10 | 2022-03-09T07:33:32Z | b2c0a318-a83c-5602-9b00-9b042e574c48 |
+----+----------------------+--------------------------------------+
| 11 | 2022-03-26T14:14:41Z | c75b7253-1cde-52b0-93ba-0c9d90ce9163 |
+----+----------------------+--------------------------------------+
| 12 | 2022-04-05T21:04:10Z | 08c665be-22ea-526f-9422-c38beb554118 |
+----+----------------------+--------------------------------------+
| 13 | 2022-04-05T21:04:11Z | a0d15a8b-77da-5c7c-9a77-4ab06523c98b |
+----+----------------------+--------------------------------------+
| 14 | 2021-12-03T13:10:53Z | e3cdd8d9-46e7-52a4-9334-442f9e5f7490 |
+----+----------------------+--------------------------------------+

Did this answer your question?