Alignment for table cells
See original GitHub issueI’d like to right-justify some currency amounts and cannot figure out how to get it to work. I tried your example, but altered the columns to have an align
key like so:
var columns = [
{title: "ID", key: "id", align: "right"},
{title: "Name", key: "name", align: "right"},
{title: "Country", key: "country", align: "right"},
{title: "Email", key: "email", align: "right"}
];
The PDF was generated successfully, but unfortunately the cell contents were not aligned like I specified. Is this possible, and if so, how should I configure the options or column keys?
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
CSS Table Alignment - W3Schools
The text-align property sets the horizontal alignment (like left, right, or center) of the content in <th> or <td>. By default, the content...
Read more >(Legacy) HTML: Tables: Alignment Within a Table
It is possible to change the horizontal alignment of items within table cells. Table data defaults to left alignment; table headers to ...
Read more >How to center align text in table cells in HTML? - Tutorialspoint
We use the CSS property text-align, to center align text in table cells. We use inline, internal style sheet for text alignment in...
Read more >What is the best practice for data table cell content alignment
The points relevant to alignment of table data are: Left align text (where appropriate); Right align numbers (where appropriate) ...
Read more >Table Cells 1 - Space and Alignment - Iron Spider
The cellspacing and cellpadding attributes are used in the <table> tag and apply to all cells in the respective table. The align and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just in case someone finds this issue. I’ve used a solution shown here: https://jsfiddle.net/j9vaqpnz/10/
Thanks for the info.