• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 12. Setting Up Tables > Sorting Table Contents

Sorting Table Contents

Typing stuff into a table can be a pain in the butt if you need the contents to be in order. In Microsoft Word and Microsoft Excel, you can type the stuff in any order you like and then sort table contents alphabetically or numerically. In Dreamweaver, you can do it, too. No, really!

To sort table contents

In Standard mode, click within the table you want to sort.

From the menu bar, select Commands > Sort Table. The Sort Table dialog box will appear (Figure 12.93).

Figure 12.93. Use the Sort Table dialog box to specify criteria by which to sort the contents of a table.

From the Sort By drop-down menu, select the column (by number) to sort by first.

From the Order drop-down menu, select Alphabetically or Numerically.

Name That Table

If you're planning on working with table code directly, it may help to know which table you're working on, particularly if you've inserted a table within a table. You can name your table, in which case the table code will say something like:

<table name="main">

To name your table, first select it. Then, while in Standard mode, in the Property inspector, type a name in the Table ID text box (Figure 12.94), and press Enter (Return). The table name will be inserted into the code.

Figure 12.94. Type a name in the Table ID text box.

You'll also be able to select IDs from a menu if you've inserted more than one on your page. You can use the table ID or table name if this table will be drawn on the page with interesting CSS borders, or if it will otherwise be controlled, changed, or populated by a script or by CSS.

See Figures 12.31 to 12.34 for more views of the Property inspector. The menu aspect of the Table ID text box is new in MX 2004.

From the next drop-down menu, select Ascending (A–Z, 1–9) or Descending (Z–A, 9–1).

To sort by a secondary column next, repeat Steps 3 through 5 for the Then By section of the dialog box.

To include the first row in your sort, check the Sort Includes First Row checkbox. To include table headers and footers in your sort, select the checkboxes for THEAD and TFOOT rows.

To have any row formatting travel with the sort, check the Keep TR Attributes With Sorted Row checkbox.

Click OK to close the Sort Table dialog box. The table will be sorted according to the criteria you specified.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint