PACKTABLE Procedure
Writes out an HTML table to the open HTML file.
Usage
PACKTABLE, table_text, key_name, ret_asarr
Input Parameters
table_text—A string array of what will be in the table. An (m, n) array will build a table with m columns and n rows
key_name—A scalar string naming the key that will reference the HTML table in ret_asarr.
ret_asarr—The associative array that will contain the HTML table. If ret_asarr is undefined, PackTable will create ret_asarr.
Keywords
Whenever a specified attribute is not supported by a particular browser, the attribute is simply ignored by that browser.
Border—Sets the BORDER attribute of the HTML table, which defines the thickness of the border around cells in the table.
Bottom—If nonzero, sets the VALIGN attribute of the HTML table, which defines the vertical alignment of the cell contents.
Caption—A scalar string. Sets the CAPTION attribute of the HTML table, which defined the title given to the table.
CBottom—If nonzero and the Caption keyword is also set, the caption is placed at the bottom of the table.
CellPadding—Sets the CELLPADDING attribute of the HTML table, which defines spacing between the borders and the contents of cells.
CellSpacing—Sets the CELLSPACING attribute of the HTML table, which defines the space between each individual cell.
Center—If nonzero, sets the ALIGN attribute of the HTML table, which defines the horizontal alignment of the cell contents.
ColLabels—A string array of column labels. If table_text is MxN then ColLabels must be length M.
EqualWidth—If nonzero, all cells have the width of the widest cell.
Left—If nonzero, sets the ALIGN attribute of the HTML table, which defines the horizontal alignment of the cell contents.
Middle—If nonzero, sets the VALIGN attribute of the HTML table, which defines the vertical alignment of the cell contents.
NoWrap—If nonzero, the cell contents do not wrap.
Right—If nonzero, sets the ALIGN attribute of the HTML table, which defines the horizontal alignment of the cell contents.
RowLabels—A string array of row labels. If table_text is MxN then RowLabels must be length N.
Safe—If nonzero, any characters in table_text that could be misinterpretted as an HTML special character (<, >, &, ") are escaped.
TCenter—If nonzero, sets the ALIGN attribute of the HTML table itself, which defines the horizontal alignment of the table in the page.
TLeft—If nonzero, sets the ALIGN attribute of the HTML table itself, which defines the horizontal alignment of the table in the page.
Top—If nonzero, sets the VALIGN attribute of the HTML table, which defines the vertical alignment of the cell contents.
TRight—If nonzero, sets the ALIGN attribute of the HTML table itself, which defines the horizontal alignment of the table in the page.
Discussion
This function takes string data and converts it into an HTML table format. The HTML table data is converted to a 1D byte array. The array is then stored in an associative array which is returned to the calling procedure. The calling procedure then returns this data to the servlet.
The HTML table data is converted to byte because of a limitation in the size of strings that JWAVE can handle. In the servlet, this byte array is converted back into a string, and it is then forwarded to a JSP page for the client to display.
Example
a = STRTRIM(STRING(INDGEN(3)), 2)
b = STRTRIM(STRING(LINDGEN(3)), 2)
c = STRTRIM(STRING(FINDGEN(3)), 2)
d = STRTRIM(STRING(DINDGEN(3)), 2)
e = STRTRIM(STRING(CINDGEN(3)), 2)
f = TRANSPOSE([[a], [b], [c], [d], [e]])
PackTable, f, 'table', ret_asarr, Border=2, /Equalwidth, $
/Nowrap, /Middle, /Center, ColLabels=['Int', 'Long', $
'Float', 'Double', 'Complex'], $
Caption = 'Some PV-WAVE data types'
See Also
Version 3.6
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.