What is the best practice for data table cell content alignment

  • We are currently working on a windows based application where users capture data. Some data is captured in a table where other data is captured in text blocks. Im currently faced with the dilemma of how to align contents specifically decimal values. Editable cells in a grid are indicated with a pencil icon which disappears once in edit mode. You will notice that the table consists of various field types, decimals and text. So what should I do and why?

    A> right align all cell content

    B> left align all cell content

    C> right align only decimal values in cells

    D> Whatever else you can suggest

    enter image description here

    Decimals (more importantly, dollar amounts) should *always* be right aligned; just ask your accounting department :)

    Why is it you're considering right alignment at all? Surely the western standard of left-to-right means content should be left aligned? (assuming it's a LTR userbase)

    @BenBrocka why do you say that

    edit - seeing it as a table I realise what you mean now. I still think left alignment is readable enough to the average user though!

    @mervinj try adding up numbers when 13234 143 and 64 are left aligned. Right alignment keeps the order of magnitude in the same place for each row. There's a reason in math class the numbers are right aligned when working out addition/"carry the one" style problems

    @BenBrocka thats a valid point regarding the maths suming up of numbers, but these users are not doing the addition themselves, would the validity of right alignment still apply. I noticed that Microsoft excel also right aligns currency values. Why though?

    @HarveyZA I think you do additon/comparison more than you might think; the right aligning doesn't have to be for summing up the whole line or anything, but it makes all sorts of judgements (hey, item X is 10x more expensive!) a lot easier

  • Ben Brocka

    Ben Brocka Correct answer

    9 years ago

    Left align is basically the default for Left to Right languages just because all content will line up; this is a powerful tool for readability. Generally stick with left aligning unless there's good reason not to.

    The exception, as you notice, is numbers. Here's a little blurb by Christian Heilmann:

    I chatted quickly with Luke Wroblewski about it (one perk of working in the same company) and we both agreed that if there are several fields, for example in a spreadsheet application, then monetary or generally number fields should be right aligned as that allows you to add them up quickly in your head without having to worry about decimals.

    Especially in accounting spreadsheets numbers (especially dollar amounts) are almost always right aligned as this lines up the "decimal point" of the numbers and makes sure each column of numbers is the same order of magnitude, making for very easy in-your-head math. You can easily add up all the millions/tens/whatever order of magnitude without having to check the length of each number to see what the magnitude of the rightmost digit is.

    As an added appeal to consistency, and accountants/financially inclined people are likely used to right alignment for the numbers, and if you ask them they'll probably tell you why; it's easy to add them up. I've gotten complaints when a report for accounting has left-aligned numbers; it's just not "natural" due to the convention, and as I've explained, the convention makes good sense.

License under CC-BY-SA with attribution

Content dated before 7/24/2021 11:53 AM