Create an HTML Invoice: Difference between revisions

m
add syntax highlighting
No edit summary
m (add syntax highlighting)
Line 9: Line 9:
A “span” tag is used to group HTML and can also be used to “hook” information onto that HTML.  Here we will use it to enforce accurate positioning of the data elements on top of the image.  An example will help.
A “span” tag is used to group HTML and can also be used to “hook” information onto that HTML.  Here we will use it to enforce accurate positioning of the data elements on top of the image.  An example will help.


<pre>
<source lang="html">
     <form>
     <form>
         <span id=”rel” style="FLOAT: left; POSITION: relative">
         <span id=”rel” style="FLOAT: left; POSITION: relative">
Line 25: Line 25:
   </form>
   </form>


</pre>
</source>


Normally a span or div tag with some kind of positioning will position itself relative to the upper left corner of the browser.  That would be ok if you only ever used that particular browser and only one page.  The difficulties begin when you page down and back, or print - the positioning becomes unstable and you can't count on anything being shown in exactly the same place every time.
Normally a span or div tag with some kind of positioning will position itself relative to the upper left corner of the browser.  That would be ok if you only ever used that particular browser and only one page.  The difficulties begin when you page down and back, or print - the positioning becomes unstable and you can't count on anything being shown in exactly the same place every time.
Line 35: Line 35:
If you want to have multiple pages, it gets a little more complicated as you will need a table to hold it all.  In the cell, just before the second page, simply force a pagebreak as shown in the pseudo code below.  Printing of the invoice pages should track the browser layout exactly! And, be browser independent. If it doesn't - the browser shows one way and printing shows everything in a different position, then something is incorrect.
If you want to have multiple pages, it gets a little more complicated as you will need a table to hold it all.  In the cell, just before the second page, simply force a pagebreak as shown in the pseudo code below.  Printing of the invoice pages should track the browser layout exactly! And, be browser independent. If it doesn't - the browser shows one way and printing shows everything in a different position, then something is incorrect.


<pre>
<source lang="html">
   <table>
   <table>
     <tr>
     <tr>
Line 73: Line 73:
     <tr>
     <tr>
   </table>
   </table>
</pre>
</source>


'''Showing the data'''<br>
'''Showing the data'''<br>
The invoice data is shown in regular input fields, but the borders are suppressed. Put the following in your "head" section.   
The invoice data is shown in regular input fields, but the borders are suppressed. Put the following in your "head" section.   
The bk tag makes adding a pagebreak easy.<br>  
The bk tag makes adding a pagebreak easy.<br>  
<pre>
<source lang="html">
     <style>
     <style>
         input {font-weight: bold; type="text"; border: 0; font-size: 10px; readonly="readonly"; }
         input {font-weight: bold; type="text"; border: 0; font-size: 10px; readonly="readonly"; }
         bk {page-break-after: always;}
         bk {page-break-after: always;}
     </style>
     </style>
</pre>
</source>


[[Image:WaybillSample.JPG]]
[[Image:WaybillSample.JPG]]