HTML Table Procedures

The following table describes HTML table procedures:

Procedure

Description

html_caption

Marks the start of a table caption by using the HTML <CAPTION> tag.

Syntax:

html_caption(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <CAPTION> tag.

html_caption_end

Marks the end of a table caption by using the HTML </CAPTION> tag. The end of a table caption is typically implied and not needed; however, you should specify it for completeness.

Syntax:

html_caption_end 

html_table

Marks the start of a table by using the HTML <TABLE> tag.

Syntax:

html_table(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <TABLE> tag.

Some common attributes include:

  • border: Specifies that a border appears around each cell of a table.

  • width: Specifies the width of an entire table in pixels.

  • cols: Specifies the number of columns in a table.

    Example: COLS=4

Example: Displaying database records in a tabular format. The html_caption_end, html_tr_end, html_td_end, and html_th_end procedures are used for completeness; however, they are typically implied and not needed.

! start the table & display the column headings
do html_table('border')
do html_caption('')
print 'Customer Records' (1,1)
do html_caption_end
do html_tr('')
do html_th('')
print 'Cust No' (+1,1)
do html_th_end
do html_th('')
print 'Name" (,10)
do html_th_end
do html_tr_end
! display each record
begin-select
do html_tr('')
do html_td('')
cust_num   (1,1,6) edit 099999
do html_td_end
do html_td('')
name     (1,10,25)
do html_td_end
do html_tr_end
next-listing skiplines=1 need=1
from customers
end-select
! end the table
do html_table_end

html_table_end

Marks the end of a table by using the HTML </TABLE> tag.

Syntax:

html_table_end 

html_td

Marks the start of a new column in a table row by using the HTML <TD> tag. This tag specifies that the text that follows appears in the column.

Syntax:

html_td(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <TD> tag.

html_td_end

Marks the end of a column in a table by using the HTML </TD> tag. The end of a column is typically implied and not needed; however, you should specify it for completeness.

Syntax:

html_td_end 

html_th

Marks the start of a new column header in a table row by using the HTML <TH> tag. This tag specifies that the text that follows appears as the header of the column.

Syntax:

html_th(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <TH> tag.

html_th_end

Marks the end of a column header in a table by using the HTML </TH> tag. The end of a column header is typically implied and not needed; however, you should specify it for completeness.

Syntax:

html_th_end 

html_tr

Marks the start of a new row in a table by using the HTML <TR> tag.

Syntax:

html_tr(string attributes)

Attributes: Defines the HTML attributes that are incorporated inside the HTML <TR> tag.

html_tr_end

Marks the end of a row by using the HTML </TR> tag. The end of a row in a table is typically implied and not needed; however, you should specify it for completeness.

Syntax:

html_tr_end