question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Alignment for table cells

See original GitHub issue

I’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:closed
  • Created 8 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
piersstoreycommented, Dec 6, 2017

Just in case someone finds this issue. I’ve used a solution shown here: https://jsfiddle.net/j9vaqpnz/10/

0reactions
chipcommented, Apr 15, 2015

Thanks for the info.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found