Sun Java Studio Creator 2 – Online Help
 

Table Component

See Also | Tutorials

You can drag the Table component Table Component Icon from the Palette's Basic category to the Visual Designer to create a table that you can fill with data from a database table or some other source of repeating information for which the number of rows is not known ahead of time. A Table component renders as an HTML <table> tag.

If you want a table that serves as an HTML layout element, use the Grid Panel component instead.

The table component itself does not define rows and columns. Those elements of the table are defined by the Column and Row Group components. However, you can right-click a table that you have dropped on your page and choose Table Layout to set things like the data provider for the object or for the database table that populates your table, the columns based on that data provider, and, for each column, the column header, column footer, the type of object in the column, the expression that populates the column, and the vertical and horizontal alignment of the column. In addition, in this dialog box you can set table characteristics such as the title, the summary and footer text, the message that displays when there is no data in the table, and buttons that enable the user to manipulate aspects of the table's display.

You can also set all these values in the Properties windows for the Table, Row Group, and Column components that comprise the table, but the Table Layout dialog saves you time going from component to component.

When you first drop a table on a page, you get a table with three columns, five rows, a default title that is selected and can be edited immediately, default headers for each column, and initial Static Text components in each table cell.

To work with the rows of the table, you can select the table's Row Group component in the Outline window. If you want different rows to do different things, you can add additional Row Group components to the table.

To work with the columns of the table, you can use the Table Layout dialog box or you can select each column of the table in turn, either in the Table component on the page or in the Outline window. You can also add additional columns one at time by dragging a Column component to a Row Group component in the Outline window.

For a detailed view of the elements of a table, see Table Component Structure.

See Also
Table Component Properties Window
Binding Component Properties
Working With Components
Component Tasks: Quick Reference
Component Web Tutorials
Data Source Web Tutorials
About the Palette
Tutorials
Delving Into Components Tutorial
Using Table Components Tutorial
Working With Databases Tutorial
Using Databound Components to Access Databases Tutorial
 
 
 
Legal Notices. Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Close