Format an html table for a task comment. Asana API

Hello. I use java asana client and I need to post a table with data in the commentary for a task. I managed to do this via api:

asanaClient.tasks.addComment(taskGid).data("html_text", <body><table> <tr><td>Name</td><td>Status</td><td>Details</td></tr></table></body>)

Everything works fine and I manage to create a table, but I need to make the right column larger than the others. It is possible to resize columns when I create a table in the web interface. Is it possible to do so via API?
I tried to make the table 100% wide and used such approaches as: <table width=100%> and <table style="width: 100%">. None of them worked out. The table still looks like this:

3 Likes

Same issue. Can manually edit the column width after but cannot set it within the html.
Please provide guidance !!

1 Like

I’m having the same issue. Has anyone found a solution?

I found Asana’s internal syntax for this by reading a task’s html_notes that contained an already-formatted table. The syntax is read-write as of 3/11/24 and is as follows:

<table>
    <tr>
        <td data-cell-widths="300">cell content</td>
    </tr>
</table>

…for a cell of desired width 300px.
I’ve only tested this when every cell has the same value; not sure if it would break in edge-cases.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.