How To Align Headers?

(4 posts) (2 voices)

Tags:

No tags yet.

  1. Steve44, Member

    I have a working report and all of the column headers text are right-aligned. I don't know why. Maybe we have a default style for headers, but I don't know where that is or how to override it. So I looked at your style documentation and I tried this code:

    SELECT 'dbr.headerstyle', 'horizontal-align: center;';

    The column headers are still right-aligned. What am I doing wrong? Is there an easy way to set header style for all columns in my report? Is there an easy way to set a common default header style for all reports?

  2. myDBR Team, Key Master

    By default myDBR aligns headers the same way it aligns the column's data: numbers, dates and times to right, strings & blobs to left. This makes reports more readable as the titles position matches the data.

    if all you headers are right-aligned (even in string columns), you might want to take a look if you are overriding the defaults. Use browser's debugger to see this.

    You should not need to realign them unless you really want. In case you want to do this, you can use text-align-property.

    --
    myBBR Team

  3. Steve44, Member

    You are right, you are right, and you are right.

    1 - You are right that the headers align based on the column data type. I see now that string column headers are left-aligned and numeric columns (and date columns) are right-aligned.

    2 - You are right that they usually look better that way so I'm going to leave them that way except I want the date columns to center the headers.

    3 - You are right that the text-align property works, not horizontal-align which I was using.

    What is the best way to change the alignment on the date columns? This seems to work:

    SELECT 'dbr.header.colclass', 'C Date', 'align_c';

    Is there a better way?

  4. myDBR Team, Key Master

    That is a good way of centering a header.

    --
    myDBR Team


Reply

You must log in to post.