HTML Printing and Styles

In an effort to have better/easier support for column alignment, I reviewed these Topics regarding HTML Printer Templates:

https://forum.sambapos.com/t/new-5-1-32-html-printer-template-tables-more-new-features/6046


As part of the first linked Topic, it is noted among the supported styles, these:

margin-top
margin-right
margin-bottom
margin-left
padding-top
padding-right
padding-bottom
padding-left

I am wondering about a couple of things:

Are the following short-format styles supported?

margin:0px  // set ALL margins to 0
padding:0px // set ALL paddings to 0

Can we define CSS “classes” in a <style> section (usually included within a <head> section), and then use the classes instead of always needing to define style in-line? For example:

<head>
<style>
.ticket {margin:0px;padding:0px;font-family:Arial;font-size:11px;text-align:left;}
.col1 {margin:0px;padding:0px;width:160;font-family:Arial;text-align:left;}
.col2 {margin:0px;padding:0px;width:75;font-family:Consolas;text-align:right;}
.col3 {margin:0px;padding:0px;width:50;font-family:Consolas;text-align:right;}
</style>
</head>

… later in Template, instead of this:

<div style="margin:0px;padding:0px;font-family:Arial;font-size:11px;text-align:left;">
<table>
<tr><td width=160>Tax Total:</td><td width=75 align=right>(L[=F(TN('{TAX TOTAL}')/TN('{EXCHANGE RATE:HNL}'))])</td><td width=50 align=right>[=F('{TAX TOTAL}')]</td></tr>
</table>
</div>

… we can do this?

<div class="ticket">
<table>
<tr><td class="col1">Tax Total:</td><td class="col2">(L[=F(TN('{TAX TOTAL}')/TN('{EXCHANGE RATE:HNL}'))])</td><td class="col3">[=F('{TAX TOTAL}')]</td></tr>
</table>
</div>

Unfortunately it does not have class support. That was an old open source Microsoft library that makes conversions between HTML and XAML but it abandoned and never updated. I made some changes to improve table support but that’s all we have :slight_smile:

1 Like