Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Creating a Spry table

From: Dreamweaver CS3 Beyond the Basics

Video: Creating a Spry table

Our last exercise focused on defining a Spry data source, and now that we have that data source, let's take a look at how we can get the data on the page. Now, before we use any of the Spry Objects, let's go ahead and add a little structure to our page to make it easier to display both the Spry Table that we are going to use and the Widget that we will use a little bit later on. So we are still working in our current.htm file, so I will scroll down. A little bit further down the page, at the bottom we have a Note from the artist. We need to go ahead and highlight just the text that makes up the note. So leave the headline, Note from the artist, alone, you just want to highlight that.

Creating a Spry table

Our last exercise focused on defining a Spry data source, and now that we have that data source, let's take a look at how we can get the data on the page. Now, before we use any of the Spry Objects, let's go ahead and add a little structure to our page to make it easier to display both the Spry Table that we are going to use and the Widget that we will use a little bit later on. So we are still working in our current.htm file, so I will scroll down. A little bit further down the page, at the bottom we have a Note from the artist. We need to go ahead and highlight just the text that makes up the note. So leave the headline, Note from the artist, alone, you just want to highlight that.

We will go ahead and use the Command+T or Ctrl+T Quick Tag Editor to bring that up, and that allows us to Wrap this content in a div tag. So we are going to type in div, and we are going to do id =, and I want you to use the rightCol id. Now notice, if you type in r, the code heading jumps right down to rightCol. Well, that's because that is a style that already exists in our external CSS. So we are going to hit Enter and then Return. Sure enough, the code reformats and moves over to the right hand side.

Now one of the neatest tricks that I know of in Dreamweaver is this. Let's say we want to place our cursor just to the left of the div tag and insert another div tag on that side. Well, trying to click with your cursor would be very difficult, but if you will notice, the div tag that we just inserted is highlighted in blue. That means that we have the entire div tag selected. Use your arrow keys and select the left arrow. That's going to place your cursor immediately to the left of whatever element that you just had selected. So that is one of the great ways of getting your cursor into a very tight spot that would be otherwise difficult to select.

Let's click on our Layout tab in our Insert toolbar, and let's click on the Insert Div Tag icon to insert a div tag just to the left of our icon. We want to insert this at the insertion point, so we don't want it to wrap around anything. For ID, let's go ahead and give it the ID of leftCol. So instead of rightCol, it will be leftCol. Go ahead and click OK. Now anytime you place a div tag on a page that's empty, Dreamweaver does this very helpful thing to you. It just goes ahead and throws some content in there. So you can see we have a div tag sitting over there now that says Content for id leftCol Goes Here, so now we know exactly where that leftCol is and where our information is going to go.

So we have got our page structured now and we are ready to go ahead and place our Spry data on the page. Highlight, the Content for id leftCol Goes Here. We are going to replace that with our Spry data. Now there are a lot of different ways to get Spry data onto the page. Let's go back to our Insert toolbar and click on the Spry tab again. I want to focus on the left hand side; those five left hand icons over there. The first one we just used, that was a Spry XML Data Set. But then we have the Spry Region, Spry Repeat, Spry Repeat List, and then the Spry Table.

Now we are going to use the Spry Table, but I want to point out something about placing Spry data on the page. To use Spry data on the page, you first have to have that inserted into a Spry Region. So a lot of the things that we are going to do in the course of these exercises will put the Spry Region on the page for us automatically, but if you are ever hand-coding it or just trying to do drag and drop Binding on the page, remember that it needs to be nested inside of a Spry Region in order for you to be able to see it. So we are going to use the Spry Table. Tables do a great job of displaying data. In this case we need to display a list of paintings and the paintings' price, so a table would be a pretty good element to place that data in.

So I am going to click on Insert > Spry Table, and I get the Insert Spry Table dialog box that comes up. The first thing that it asks me is which Spry Data Set do you want to use, and we are just going to stay with dsShow. It's the only one that we have. The next thing we need to tell it is which elements in our data set we want to include in our table. Well, we only need two, the name of the painting and the price. So select each of the individual elements and click the minus symbol until all you have left are the name and the price. Now to the right of that it asks you if you want to make them sortable. Now you do that by clicking the checkbox just below this window. So I am going to select name and make that sortable, then I will select price and we will make that sortable too.

The reason that we are doing that is so that users will be able to click on the name of the painting and sort by that column and users will also be able to click on the price and sort it by that. So if they are looking for the cheapest painting or the most expensive painting or just sort the paintings in alphabetical order, clicking Sort will allow them to do that. Just below that we have four Form elements that allow us to assign classes to different events in our table. Notice we have an Odd and an Even row class, a Hover class, and a Select class. These styles have been predefined for us, so we can just pick them from our pulldown menu. Anytime that you are going to insert this type of a Spry Table or Spry information on the page, a lot of times you will have an opportunity to style them. So you may want to become really familiar with these elements so that you will know which styles to create beforehand.

For the Odd row class, I am going to grab the pulldown menu and choose odd. What it's doing is its showing you all of the class styles available in your style sheet. For the Even row class, I am going to choose even. For the Hover class, choose hover, and for the Select class choose selected. So it's a good idea to go ahead and name those classes something that's going to be rather intuitive when you get to this stage. Now the other thing that I am going to check is Update detail region when row is clicked. It's not going to mean anything for us right now, but when you are using sort of a master detail set, like we are, we have a list on the left hand side and we have information that we want to update on the right hand side, you first need to check this, because that's going to basically tell Dreamweaver that you want this to become part of a master detail set.

So we will go ahead and click OK. It's going to prompt you and ask you if you want to Add a Spry Region. Now, I mentioned before that you have to have a Spry Region in order for this to display, and you might think, well, why would it even ask me this? Well, you might already be inside of a Spry Region, and if you are, you don't need to add another one, but we are not, so we are going to click Yes. So it adds a Spry Region on the page for us, and now we have got our name, our price. So I am going to switch over to Code View so that we can actually see what this has done for us.

So as I scroll down the code, scroll down until I find my Spry Region and I can find that around Line 42. So it placed a div tag on the page for us and it's a Spry Region, so note the actual syntax. spry:region= and then it passes along the data set. Notice that we are using a Spry sort on the two table headers and we are using the @name and the @price inside there. Then we have a Spry repeat region on a table row and that's going to repeat that over and over again. Now in a later exercise we will be doing a Repeat Region by hand. So I am going to switch back over to Design View, and I am going to modify a few things here.

First up, I don't like having @name display as the actual column header, so I am going to highlight that, and I am just going to type in the word, Painting. I am going to highlight price and I am just going to remove the @ symbol from that. You will notice that it didn't ask me if I wanted to do a style for my table header, so I am going to select that table row by clicking just to the left of it, and using my Properties inspector, I am going to go ahead and assign a class to that. So where it says Style, None right now, I am going to grab that pulldown menu and I am just going to cycle through my classes until I find top. There we go.

See how this worked. We will go to File and choose Save, and we will Preview that in our browser. As it previews in the browser, our table builds out. I am going to scroll down just a little bit so we can see the table a little bit better. Notice that as I hover over it, we get the Hover Effect. If I click on Painting, it will sort by painting. If I click on price, it sorts by price. If I actually click on one of these, I get an Active or Selected link. Now, that doesn't really mean anything right now, but later on when we add our detailed set to the right side over here, that will indicate which painting is the current painting that we are looking at.

So we have defined a data set. We have placed some data on the pages. Let's take a look at our next series of exercises using what's known as a Spry Widget to add even more user interaction and interactivity to the page.

Show transcript

This video is part of

Image for Dreamweaver CS3 Beyond the Basics
Dreamweaver CS3 Beyond the Basics

102 video lessons · 38692 viewers

James Williamson
Author

 
Expand all | Collapse all
  1. 2m 3s
    1. Welcome
      1m 17s
    2. Using the exercise files
      46s
  2. 1h 23m
    1. Reviewing the Coding toolbar
      8m 42s
    2. Customizing the Coding toolbar
      9m 52s
    3. Taking advantage of Code Hinting
      7m 20s
    4. Using snippets and shortcuts
      11m 10s
    5. Using the Quick Tag Editor
      5m 18s
    6. Using Find and Replace
      9m 50s
    7. Regular expressions
      5m 39s
    8. Using Bridge with Dreamweaver CS3
      8m 28s
    9. Round-trip editing with Photoshop CS3
      3m 40s
    10. Leveraging image variables in Photoshop CS3
      7m 32s
    11. Integrating external variables into your workflow
      6m 16s
  3. 37m 26s
    1. Understanding the CSS Styles panel
      7m 59s
    2. Understanding the Cascade
      5m 50s
    3. Understanding Inheritance
      5m 8s
    4. Understanding Specificity
      7m 5s
    5. Managing CSS styles
      5m 4s
    6. Using Design-Time style sheets
      6m 20s
  4. 2h 19m
    1. Using the new CSS template pages
      5m 59s
    2. Understanding DIV tag structure and layout
      12m 0s
    3. Understanding the CSS box model
      10m 0s
    4. Using absolute and relative positioning
      8m 35s
    5. Understanding floating elements
      7m 9s
    6. Clearing floats
      7m 19s
    7. Using floats to control page layout
      3m 45s
    8. Building structure and assigning IDs
      10m 19s
    9. Applying basic styling to structured content
      11m 14s
    10. Positioning container elements
      11m 4s
    11. Enhancing layouts with background graphics
      11m 48s
    12. Creating faux columns with background graphics
      8m 55s
    13. Creating rounded corners with background graphics
      9m 17s
    14. Building navigation with CSS
      16m 57s
    15. Using Dreamweaver's Browser Check feature
      5m 31s
  5. 53m 22s
    1. Creating properly structured forms
      6m 30s
    2. Creating accessible forms
      6m 41s
    3. Using CSS to lay out form structure
      7m 40s
    4. Creating vertical columns for form elements
      7m 48s
    5. Adding user feedback
      5m 52s
    6. Applying advanced styling to forms
      8m 11s
    7. Client-side form validation
      4m 17s
    8. Validating forms with the Spry Validation tools
      6m 23s
  6. 1h 20m
    1. Understanding the Spry framework
      3m 43s
    2. Defining a data source for use in Spry
      3m 56s
    3. Creating a Spry table
      8m 8s
    4. Using the Spry widgets
      8m 11s
    5. Connecting various data sets
      4m 50s
    6. Understanding Spry widget structures
      7m 1s
    7. Applying custom styles to Spry widgets
      6m 24s
    8. Applying additional custom styles to Spry widgets
      8m 46s
    9. Controlling Spry widget behaviors with JavaScript
      6m 0s
    10. Controlling Spry widget animations with JavaScript
      9m 31s
    11. Creating effects with Spry behaviors
      4m 42s
    12. Hand-coding Spry
      9m 11s
  7. 1h 11m
    1. Creating a base template
      8m 6s
    2. Creating editable attributes
      6m 26s
    3. Creating a new page from a template
      7m 42s
    4. Applying a template to an existing page
      4m 36s
    5. Creating nested templates
      5m 24s
    6. Using repeating regions
      6m 34s
    7. Creating editable and non-editable optional regions
      6m 0s
    8. Using template parameters
      7m 26s
    9. Using template expressions
      9m 59s
    10. Using conditional template expressions
      8m 54s
  8. 54m 40s
    1. Examining XML structure
      2m 44s
    2. Creating an XML document
      9m 9s
    3. Using the CDATA structure
      5m 7s
    4. Creating an XSLT file
      4m 33s
    5. Binding data from an XML to an XSLT document
      5m 6s
    6. Inserting repeating regions into an XSL document
      5m 16s
    7. Creating a client-side XSL transformation
      2m 52s
    8. Styling a remote RSS feed
      7m 29s
    9. Creating a server-side XSL transformation
      5m 31s
    10. Writing XSL expressions
      6m 53s
  9. 1h 2m
    1. Overview of building dynamic websites
      1m 35s
    2. Installing PHP, MySQL, and Apache on Mac
      3m 22s
    3. Installing PHP, MySQL, and Apache on Windows
      3m 54s
    4. Creating a MySQL database
      3m 16s
    5. Defining a testing server and database bindings
      6m 14s
    6. Creating a database recordset
      4m 35s
    7. Adding dynamic content to the page
      5m 14s
    8. Creating repeating regions of dynamic content
      7m 6s
    9. Filtering database records
      7m 39s
    10. Using the Live Preview
      10m 22s
    11. Passing URL parameters
      4m 23s
    12. Dynamically generating links
      5m 18s
  10. 57m 9s
    1. Understanding behaviors
      5m 16s
    2. Installing additional behaviors
      3m 39s
    3. Planning to create a custom behavior
      3m 42s
    4. Examining existing behaviors
      5m 32s
    5. Building a behavior function
      7m 23s
    6. Creating an Action file
      6m 48s
    7. Enabling behavior functions
      9m 1s
    8. Initializing the user interface for a behavior
      3m 9s
    9. Loading behaviors in Dreamweaver
      6m 47s
    10. Testing and debugging behaviors
      5m 52s
  11. 27m 12s
    1. Running reports
      7m 41s
    2. Checking and validating links
      3m 40s
    3. Using cloaking
      5m 42s
    4. Using Check In/Check Out
      4m 3s
    5. Using Design Notes
      6m 6s
  12. 20s
    1. Goodbye
      20s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Dreamweaver CS3 Beyond the Basics.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.