Last Revised: 10/03/17 |
This program is used to create an HTML table. An HTML table is a representation of data in a grid with rows and columns.
CALL "CDW000", HTML$, OPT$, TRD$, { CHAN }
CDW000 | ||
---|---|---|
HTML$
|
To/From | CDW000 appends data to HTML$ as the table is built. |
OPT$
|
To | pass OPT$ to CDW000 with tag and attribute values (see
table below) |
TRD$
|
To | pass TRD$ to CDW000 with the current table, row, or cell contents to be added to
HTML$ .
It will be cleared by CDW000, so the calling routine does not have to,
except for table data (cell) type calls. See examples. |
CHAN
|
To | optionally passed to CDW000 as a channel number for a string file used
to store the resultant html. If a non-zero value is passed to CDW000,
then the html text will be written to the CHAN at the end of a row when the
table reaches 10,000 characters. Note that when passing CHAN , the
calling application must call CDW000 at the start of a table using the 't'
OPT$ and at the end of the table using the 'c' OPT$ .
When not passing CHAN , the application must call CDW00 at the end of the
table using the 't' OPT$ . |
The first character of OPT$
indicates the tag to be created:
t
|
table (excludes closing tag when CHAN is passed) |
c
|
table close only, when CHAN is passed |
r
|
table row |
d
|
table data (cell) |
h
|
table data (header cell) |
f
|
font |
The following characters of OPT$
indicate the attributes of the tag. The
table below lists which attributes are valid for each tag.
Note that CDW000 can be used with and without cascading style sheets. It is always preferred to use a style sheet as opposed to hard coding the colors, font and border styles, etc. in the bbx program, as a single change to the style sheet can be easily made without changing each bbx program.
In order to create tables with rows of alternating background text colors, CDW000
will assign class='rowodd'
to odd numbered rows, and class='roweven'
to even
numbered rows in the table. You can disable this by setting global "WMS_CDW000_RC"
to null once before calling CDW000 for the first time,
i.e., TMP$=STBL("WMS_CDW000_RC","")
.
As of this writing, some email clients including Google Mail and Hotmail do
not support <style>
tags within the email. They do, however,
support inline styles as attributes within a tag, such as <td
style='background-color:#eeeeee'>
. Set the first character of
global WMS_CDW000
to "D"
indicating to create a Dynamo
Standard format using inline styles. This will make the table larger, but
will be supported by all email clients and web browsers.
Dynamo Standard Table |
|||||||
---|---|---|---|---|---|---|---|
tag |
style will include | ||||||
<table>
|
border-collapse:collapse
|
||||||
<td>
|
border:1px solid #c0c0c0;padding:1px 3px 1px 3px
|
||||||
<th>
|
border:1px solid #c0c0c0;padding:1px 3px 1px
3px;font-weight:normal;text-align:left
|
||||||
<tr>
|
|
Click here for a good example of popular html colors by color# and name that are supported by all browsers.
Example of a sub-routine to create HTML tables for a bill to address, ship to address, and invoice heading fields. |
1000 EXAMPLE:
|
Bill To | Ship To |
Excellware, Inc PO Box 33114 North Royalton, OH 44133 |
Excellware, Inc Attn: Len Krause 8050 Corporate Cir STE 1 North Royalton, OH 44134 |
Your PO# | Invoice# | Invoice Date | Terms of Sale | Due Date |
8812345 | 7045 | 03/04/07 | Net 20 Days | 03/24/07 |
Note that since this document uses a cascading style sheet, the wider top border, border style and color were determined by the style sheet and not by CDW000.
Email Example |
To email the above data, with no operator intervention, you would open the printer using CDS084 and print HTML$ to the printer channel. If operator intervention is required, to enter 'cover page text' for example, then omit S084.MODE$="E". |
0100 REM "Example emailing CDW000 output
|