Creating Tables

You have a fair amount of control over tables in Web, including whether the table dimensions are absolute or relative, lots of formatting options, and other options.

Setting Up How Tables Are Created By Default

Before you begin, complete table setup options first. If you're having problems with tables, it's probably because of a setting that's doing stuff you don't expect. Refer to Figure 15-7; open the window by choosing Tools > Options > HTML Document > Table.

Figure 15-7. Setting table options

graphics/15fig07.jpg

Quickstart: Using the Table Formatting Icons in the Toolbar

The table feature in Web is similar to Writer's, though not identical. When you select or insert a table (choose Insert > Table), the table object bar appears (Figure 15-8).

Figure 15-8. Table object bar

graphics/15fig08.jpg

Note

If you don't see the table object bar, choose View > Toolbars and mark Object Bar. If it still doesn't appear, click the arrow at the far right of the object bar.


Inserting a New Table

To insert a new blank or preformatted table, follow these steps.

  1. Choose Insert > Table.

  2. If you want to make a relatively basic table, make the appropriate entries in this window (Figure 15-9) and click OK. You're done.

    Figure 15-9. Creating a table

    graphics/15fig09.jpg

  3. To take advantage of the program's predefined formats, click AutoFormat and select one of the formats in the AutoFormat window (Figure 15-10), then click OK.

    Figure 15-10. Selecting or creating a predefined format for the table

    graphics/15fig10.jpg

Modifying Table Dimensions

Once you've got the table, here's how to tweak it using menus and the table object bar.

Column/Row Dimensions

Select the cell, column, or row you want, and right-click. Choose Row, Column, or Cell to get options for modifying the width, etc.

You also can click anywhere in the table and see the vertical bars marking each column. Drag them to change column width.

The table generally wants to keep its full width and won't let you modify it via changing column width. You'll need to change the overall table dimensions.

Table Dimensions
  1. To change overall table width, right-click and choose Table.

  2. In the Table window's Table tab, select any alignment except Automatic.

    Note

    This is important; in order to make the table width relative to the page, for example, the Relative option in the Table tab needs to be enabled. It's grayed out, however, when Automatic alignment is selected, and Automatic is the default when the program creates a table.

  3. To enter an absolute width, enter a measurement in the Width field; to make the width a proportion of the displayed page, select Relative and enter a percentage.

Formatting Text in a Table

When you insert a table, the text object bar disappears and the table object bar replaces it. To get at the text formatting object bar when you're in a table, use the arrow at the far right side of the object bar. (If you can't see it, enlarge the window or click the small down arrow at the right side of the object bar.)

graphics/15inf03.jpg

Just click the arrow circled in the above figure to switch from one object bar to the other.

Once in a while, you'll click in a table and the table object bar won't appear. Again, just click the arrow to get the table object bar.

Creating Nested Tables

You've got a table, but how do you put a table inside another table? If you put the cursor inside a table cell and choose Insert > Table, the table window pops up but on the Background tab. The ability to insert another table is grayed out. So you can fool the program into thinking you're not in a table by inserting a frame in that cell, then putting the nested table inside that frame.

  1. Choose Tools > Options > Load/Save > HTML Compatibility.

  2. Be sure Netscape 4.x is selected as the export format. Click OK.

  3. In an HTML document, choose Insert > Table and make the first table the way you want it. This is the top table; you'll create the table inside it in the following steps.

  4. Click inside the cell where you want to add the nested table.

  5. Choose Insert > Frame. The frame will appear in the cell as shown in Figure 15-11.

    Figure 15-11. Inserting a frame in a table to hold the nested table

    graphics/15fig11.jpg

  6. Click in the frame.

    graphics/15inf04.gif

  7. Choose Insert > Table and create the inner table as shown in Figure 15-12.

    Figure 15-12. Inserting the nested table in the main table

    graphics/15fig12.jpg

  8. Format the tables as you want them, as shown in Figure 15-13.

    Figure 15-13. Formatting main and nested table

    graphics/15fig13.jpg

The HTML source that's created looks like Figure 15-14 below.

Figure 15-14 HTML source created from nested tables
[View full width]
  <TABLE WIDTH=935 BORDER=1 CELLPADDING=5 CELLSPACING=4>  <COL WIDTH=360>     <COL WIDTH=120>     <COL WIDTH=115>     <COL WIDTH=159>     <COL WIDTH=105>  <THEAD>   <TR VALIGN=TOP>  <TH WIDTH=360 BGCOLOR="#cccccc">                 <P><FONT FACE="Arial, sans-serif">Beginning Java</FONT></P>             </TH>             <TH WIDTH=120 BGCOLOR="#cccccc">                 <P><FONT FACE="Arial, sans-serif">Intermediate Java</FONT></P>             </TH>             <TH WIDTH=115 BGCOLOR="#cccccc">                 <P><FONT FACE="Arial, sans-serif">Distributed Java</FONT></P>             </TH>             <TH WIDTH=159 BGCOLOR="#cccccc">                 <P><FONT FACE="Arial, sans-serif">Enterprise JavaBeans</FONT></P>             </TH>             <TH WIDTH=105 BGCOLOR="#cccccc">                 <P><FONT FACE="Arial, sans-serif">Jini and Jiro</FONT></P>             </TH>  </TR>   </THEAD>   <TBODY>   <TR VALIGN=TOP>  <TD WIDTH=360>  <P><IMG SRC="nestedtable_html_8bcd267.gif" NAME="Frame1" ALT="Frame1" graphics/ccc.gif ALIGN=BOTTOM></P>  </TD>             <TD WIDTH=120>                 <P>Visual Basic and C++ Programmers</P>             </TD>             <TD WIDTH=115>                 <P>.NET converts</P>                 <P>Java Certified Programmers</P>             </TD>             <TD WIDTH=159>                 <P>.NET converts and Web developers</P>             </TD>             <TD WIDTH=105>                 <P>Java Certified Architects</P>             </TD>  </TR>   </TBODY>   </TABLE>  <P><BR><BR> </P> </BODY> </HTML> 


OpenOffice. org 1.0 Resource Kit
OpenOffice.Org 1.0 Resource Kit
ISBN: 0131407457
EAN: 2147483647
Year: 2005
Pages: 407

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net