PropagandaMedia > Dreamweaver tutorials > Intermediate > Tables

| Definitions | Creating Tables | Attributes | Selecting Table Elements | Formatting | Sorting | Adding and deleting table elements |

Table Definitions

Tables are useful for laying out data. They can also be used to control where text and graphics appear on a page. Once you create a table, you can add content, modify cell and row properties, and copy and paste multiple cells.

Tags

<table> </table>
The table tag defines the table. Example attributes to be included are align, border, bgcolor, width, height, nowrap.
<tr> </tr>
Example attributes to be included are valign, bgcolor, width, height, nowrap.
<td> </td>
Example attributes to be included are align, bgcolor, width, height colspan, rowspan, font face, font size.

Back to the top


Creating Tables

To insert a table:
Do one of the following:
Place the cursor where you want the table to appear on the page and click the Table button on the Common panel of the Object palette or choose Insert Table.

Drag the Table button from the Object palette to the desired location on the page.

In the dialog that appears, enter the following information:
Rows and Columns Specify the number of table rows and columns.

Cell Padding Specifies the amount of spacing between the cell content and the cell boundary (or wall).

Cell Spacing Specifies the amount of spacing between the table cell not including the border.

Width Specifies the width of the table in pixels or as a percentage of the browser window.

Border Specifies the width of the table border

Back to the top

Table Attributes

Rows/Columns
Sets the number of rows and columns of the table.
Cell Pad
The cell padding attribute controls the amount of space between the edge of a cell and its contents, which by default is one pixel.
Cell Space
The cell spacing attribute controls the amount of space between adjacent cells in a table and along the outer edges of cells along the edge of a table.
W (Width)
The width tag allows you to "widen a tag." This number can be absolute (100), or a percentage (100%)
H (Height)
The height tag allows you to recommend a height. This tag will never be "shorter "than the object in the cell.
Border (weight)
Sets the width of the link border around the image in pixels. Enter "0" for no border.
Align
Aligns the table to the browser's left (the default), right or center in 4.0 and later browsers.
V Space(Vertical Space)/H Space (Horizontal Space)
Specify the amount of space, in pixels, to leave around the table.
Border (color)
Sets the width of the border around the table in pixels.
Light Brdr/Dark Brdr
Set border colors that have a highlight and a shadow effect, respectively, to give a three-dimensional appearance to the border.
Brdr
Sets the border color of the entire table.
BG
Use the BG options to set the background image or background color for the table
Back to the top

Selecting Table Elements

With a single gesture you can select an entire table, row or column, or a continuous range of cells within a table.

To select an entire table, do one of the following:

To select rows or columns, do one of the following:

To Select one or more cells, do one of the following:

To select multiple discontinuous cells do one of the following:

Back to the top

Formatting Tables

When formatting tables in the document window you can define properties that apply to the entire table or to selected rows, columns, or cells in the table

When the same property is set more that once in a table (like a font tag), it is interpreted in this way: Cell formatting, which is part of the <td> tag, takes precedence over a table row formatting (<tr>), which in turn takes precedence over a table formatting tag (<table>).

     
     
     

 

Back to the top

Sorting

Tables

To sort the table

Select the table and choose Commands > Sort Table

In the dialog box that appears, choose from the following options:

To perform a secondary sort on a different column, specify the sort options under Then By.

Check the Sort Includes First Row option to include the first row in the sort. If the first row is a heading that shouldn't be moved, leave this option unchecked

Back to the top

Adding and deleting table elements

Use the commands on the Modify > Table menu or the commands on the shortcut menu to add and remove rows and columns from a table.

To add rows or columns:

Click in a cell where you want the new row or column to appear.

Do one of the following:

To delete a row or column:

Click in a cell within the row or column you want to delete.

Choose one of the following options:

To add or delete rows or columns from the bottom and right of a table:

Select the entire table

In the Property inspector:

Dreamweaver adds and removes rows from the bottom of the table, and it adds and removes columns to the right. Dreamweaver does not warn you if you are deleting rows that contain data.
Back to the top
< Images