Skip to content

HTML table does not apply left column alignment #427

@iluvcapra

Description

@iluvcapra

If I create an HTML table and give explicit colalign like this:

tabulate_html2_table = tabulate(data, tablefmt='html', 
                               headers=('Letter','Remark','Formula'),
                              colalign=['left','left','center'])
print(tabulate_html2_table)

The result is this:

<table>
<thead>
<tr><th>Letter  </th><th>Remark                       </th><th style="text-align: center;">          Formula           </th></tr>
</thead>
<tbody>
<tr><td>A       </td><td>First Letter of the Alphabet </td><td style="text-align: center;">          $a = 1$           </td></tr>
<tr><td>B       </td><td>Second Letter of the Alphabet</td><td style="text-align: center;">$b = \frac{2}{a\frac{2}{a}}$</td></tr>
</tbody>
</table>

The columns that should have "left" alignment do not have the text-align: left; style attribute applied. It would be great if it did! It does appear to apply the center attribute where I'm asking so the machinery seems to be basically working, the left alignment seems to be special-cased.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions