ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Custom Print Template Column Width in HTML


#1

I have created a custom app, within which I have created a new script report mimicking the salary register report. My pending goal is to be able to show the columns in the specific order as required by the local authorities. So far I have managed to:

  1. Change the order of columns and data using the python file in the directory.
  2. Change the view rendering of the report to show different column sizes, again, modifying the python file
  3. Fix the page size to a very specific width x height layout, using CSS
    (@page and the .print-format)
  4. Figured out how to properly configure the .print-heading to modify the area on top of the table to be printed.
  5. Added the company logo and sized and positioned it perfectly on the report, and it uses any .png file uploaded to public files with the name linked on the html.
  6. I can change the background color adequately with CSS
  7. Styled the font size to resize proportionately and adequately to fit as much information on the page as necessary, while remaining legible.
  8. Included the default page number counter as part of the report “Page 1 of x”
  9. All that is possible can be translated.

Now… my only limit lies in how to adequately adjust the column size regardless of the fields picked?

Should I manually call each column and manually set each on the report?
Or is there a way anyone suggests how to adjust the percentage size of each th as a parent size constraint for each td