[GNC] table header alignment in easy invoice and customer reports

James Thorpe James at fusionsystems.co.za
Fri Oct 1 06:53:30 EDT 2021


Thanks Christopher

That helped - I switched to the "CSS-based stylesheet (experimental)" 
and then did a bunch of modifications to make it look like my old "Easy" 
based report, including the one you suggested.

If it helps anyone, here are the mods I added to the end of the CSS, 
including the option of adding a banner image-

/* Center body and make it A4 width */
body {
    width: 210mm;
    margin-left: auto;
    margin-right: auto;
}

h3 {
     background-image: 
url(/home/share/james/work/fusionsystems/logos/final/banner_small.png);
     padding-top: 60px;
     background-repeat: no-repeat;
}

/* Details table (ie 5th table) to be fill body */
body > table:nth-child(5) {
    width: 100%;
}

/* Details table (ie 5th table) last 3 rows to be highlighted - totals */
body > table:nth-child(5) tbody tr:nth-last-child(-n+3) {
     background-color: yellow;
}

/* Customer and Company tables to have a bit of space below them */
body > table:nth-child(3) {
   margin-bottom: 1em;
}


Thanks again

James


On 2021/10/01 08:22, Christopher Lam wrote:
> You could edit the "CSS-based stylesheet (experimental)" and use this 
> instead of "Easy", Then add somewhere
>
> body > table:nth-child(5) > thead > tr > th {text-align:left;}
>
>
> On Thu, 30 Sept 2021 at 15:44, James Thorpe <James at fusionsystems.co.za 
> <mailto:James at fusionsystems.co.za>> wrote:
>
>     I've just migrated from an old 3.5x version to 4.8 and copied
>     across my
>     saved report configurations.
>
>     I have two - my invoice and customer report based on the "Easy
>     Invoice"
>     report with "Easy" stylesheet and "Customer Report" also with "Easy"
>     stylesheet.
>
>     The problem is that for some reason the customer information in the
>     report which is in the header in the left hand column, is not left
>     aligned any more.
>
>     I exported to HTML to see what was going on and the problem is
>     that the
>     table containing the customer information has its margins set to
>     "auto".
>     This means that it is effectively centred in the table cell that
>     wraps it.
>
>     On the Easy Invoice report I can add some custom css:
>
>     .client-table > table {width:100%;}
>
>     This fixes it there but there is no custom css option for the
>     "Customer
>     Report".
>
>     That one also exports with the table definition as follows:
>
>     <table cellspacing="1" cellpadding="1" border="0"
>     style="margin-left:auto;margin-right:auto;">
>
>     Does anyone know where I can hack the source somewhere that causes
>     this
>     table to be given these auto margin properties?
>
>     (or if there's a cleaner way of doing it, I'm all ears)
>
>     Thanks
>
>     -- 
>     --
>     James Thorpe
>     061 476 2775
>     James at fusionsystems.co.za <mailto:James at fusionsystems.co.za>
>
>     _______________________________________________
>     gnucash-user mailing list
>     gnucash-user at gnucash.org <mailto:gnucash-user at gnucash.org>
>     To update your subscription preferences or to unsubscribe:
>     https://lists.gnucash.org/mailman/listinfo/gnucash-user
>     <https://lists.gnucash.org/mailman/listinfo/gnucash-user>
>     If you are using Nabble or Gmane, please see
>     https://wiki.gnucash.org/wiki/Mailing_Lists
>     <https://wiki.gnucash.org/wiki/Mailing_Lists> for more information.
>     -----
>     Please remember to CC this list on all your replies.
>     You can do this by using Reply-To-List or Reply-All.
>
-- 
--
James Thorpe
061 476 2775
James at fusionsystems.co.za



More information about the gnucash-user mailing list