New Feature: Playlist Center! Pick a topic and let our playlists guide the way—like a learning mixtape.

Start learning with our library of video tutorials taught by experts. Get started

Dreamweaver CS6 Essential Training
Illustration by

Creating custom table borders


From:

Dreamweaver CS6 Essential Training

with James Williamson

Video: Creating custom table borders

Even before I started using CSS I have absolutely loathed the default table borders the browsers apply. Through CSS we can leave those clunky, semi-3D, beveled borders behind, and create streamlined and customized borders. Now like anything else, however, table borders created with CSS have rules that we have to follow in order to get the desired results. Let's dive in and finish off our table by adding some custom borders. I first want to show you where we are. I have opened up the graphic-design.htm file from the 09_06 directory and if I preview this in Live View; I am just going to scroll down, you can see that one of the things I have done is added a few more tables to the page, so you can really see what kind of impact our styling has when these tables are combined together.
Expand all | Collapse all
  1. 1m 4s
    1. What is Dreamweaver?
      1m 4s
  2. 5m 44s
    1. Welcome
      1m 4s
    2. Using the exercise files
      2m 17s
    3. Learning web design
      2m 23s
  3. 1h 0m
    1. Looking at the Welcome screen
      5m 9s
    2. Exploring Windows and Mac interface differences
      5m 6s
    3. Arranging panels
      8m 44s
    4. Managing workspaces
      10m 14s
    5. Exploring the Application toolbar
      6m 21s
    6. Exploring the Document toolbar
      8m 47s
    7. Working with the Property inspector
      9m 30s
    8. Using the Insert panel
      6m 30s
  4. 53m 3s
    1. Understanding basic site structure
      3m 46s
    2. Exploring file naming conventions
      2m 10s
    3. Defining a new site
      5m 23s
    4. Managing files and folders
      7m 57s
    5. Adding remote servers
      7m 4s
    6. Uploading files
      12m 46s
    7. Previewing in browsers
      9m 11s
    8. Managing multiple sites
      4m 46s
  5. 36m 41s
    1. Creating new documents
      6m 49s
    2. Setting up new document preferences
      5m 30s
    3. Setting accessibility preferences
      6m 49s
    4. Working with starter pages
      4m 32s
    5. Managing starter pages
      13m 1s
  6. 37m 23s
    1. Getting text into Dreamweaver
      8m 43s
    2. Importing Word documents
      4m 6s
    3. Adding structure to text
      7m 35s
    4. Creating lists
      4m 35s
    5. Creating definition lists
      4m 0s
    6. Using the Quick Tag Editor
      8m 24s
  7. 44m 41s
    1. Exploring the Code toolbar
      5m 41s
    2. Setting code preferences
      7m 19s
    3. Using code hints
      8m 8s
    4. Wrapping tags
      5m 7s
    5. Adding comments
      6m 29s
    6. Using snippets
      7m 32s
    7. Formatting source code
      4m 25s
  8. 1h 19m
    1. Setting CSS preferences
      9m 32s
    2. An overview of the CSS Styles panel
      9m 23s
    3. Creating a new CSS rule
      6m 42s
    4. Using the CSS Rule Definition dialog
      7m 25s
    5. Organizing styles
      7m 22s
    6. Modifying style properties
      6m 17s
    7. Controlling CSS through the Property inspector
      6m 37s
    8. Attaching external style sheets
      5m 54s
    9. Using CSS visual aids
      7m 3s
    10. Using CSS Inspect
      6m 48s
    11. Using the Code Navigator
      6m 39s
  9. 1h 11m
    1. Managing assets in Dreamweaver
      7m 30s
    2. Setting external image editing preferences
      4m 26s
    3. Placing images on the page
      10m 12s
    4. Exploring Photoshop integration
      7m 17s
    5. Modifying Smart Objects
      9m 42s
    6. Modifying image properties
      8m 4s
    7. Styling images with CSS
      6m 45s
    8. Using background graphics
      7m 28s
    9. Positioning background graphics
      10m 10s
  10. 36m 23s
    1. Link basics
      3m 17s
    2. Setting site linking preferences
      2m 19s
    3. Creating links in Dreamweaver
      9m 17s
    4. Using absolute links
      3m 43s
    5. Using named anchors
      6m 41s
    6. Creating an email link
      5m 25s
    7. Creating CSS-based rollovers
      5m 41s
  11. 44m 30s
    1. Reviewing table structure
      5m 20s
    2. Importing tabular data
      6m 46s
    3. Creating accessible tables
      6m 11s
    4. Exploring basic table styling
      9m 42s
    5. Styling alternate rows
      8m 57s
    6. Creating custom table borders
      7m 34s
  12. 59m 15s
    1. Understanding how forms work
      2m 45s
    2. Reviewing form design
      3m 44s
    3. Creating accessible forms
      5m 16s
    4. Setting form properties
      2m 39s
    5. Using the fieldset and legend tags
      2m 52s
    6. Inserting text fields
      6m 56s
    7. Inserting list menu items
      7m 54s
    8. Inserting checkboxes
      4m 14s
    9. Inserting radio button groups
      3m 52s
    10. Inserting submit buttons
      2m 25s
    11. Exploring basic form styling
      8m 2s
    12. Exploring form element styling
      8m 36s
  13. 33m 25s
    1. Adding CSS3 transitions
      8m 29s
    2. Spry overview
      2m 44s
    3. Using Spry widgets
      3m 57s
    4. Adding Spry effects
      8m 1s
    5. Using the Widget Browser
      7m 4s
    6. Extending Dreamweaver
      3m 10s
  14. 1m 2s
    1. Additional resources
      1m 2s

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
Dreamweaver CS6 Essential Training
9h 24m Beginner May 07, 2012

Viewers: in countries Watching now:

Discover how to build web sites, prototypes, and more in this course on Adobe Dreamweaver CS6. Author James Williamson shows designers how to take control of their site by properly naming and structuring files and folders; how to create new documents and web pages from scratch or with starter pages; and how to add content such as text, images, tables, and links. James also provides a background on the languages that power projects built in Dreamweaver—HTML and CSS—and introduces the programming features in the application, for developers who want to dig right into the code. The last chapter shows how to finesse your project with interactive content such as CSS3 transitions and Spry widgets.

Topics include:
  • Choosing and customizing a workspace
  • Defining a new site
  • Uploading files to your site
  • Creating new documents and web pages
  • Formatting source code
  • Working with CSS
  • Placing images and background graphics
  • Creating links
  • Styling a basic table
  • Creating a web form with buttons, check boxes, and list menus
  • Adding Spry effects
Subject:
Web
Software:
Dreamweaver
Author:
James Williamson

Creating custom table borders

Even before I started using CSS I have absolutely loathed the default table borders the browsers apply. Through CSS we can leave those clunky, semi-3D, beveled borders behind, and create streamlined and customized borders. Now like anything else, however, table borders created with CSS have rules that we have to follow in order to get the desired results. Let's dive in and finish off our table by adding some custom borders. I first want to show you where we are. I have opened up the graphic-design.htm file from the 09_06 directory and if I preview this in Live View; I am just going to scroll down, you can see that one of the things I have done is added a few more tables to the page, so you can really see what kind of impact our styling has when these tables are combined together.

Now right now currently it looks like our tables have borders, doesn't it? I mean you can see they have got white border right here between all of the table cells. Well, it's not really a border. One of the things about cell spacing; it's been made obsolete, meaning it's been removed from HTML5, but the big issue with cell spacing is that older browsers, and even current browsers to be quite honest with you. If explicit value of cell spacing isn't set to 0 for example, then it defaults to a value and in most browsers case that is one pixel spacing.

Let me show you what I mean. If I go in the Source Code here and I scroll down to the first table that I have, if I take that table and I set cellspacing to an explicit value of 0; I will save this, and now watch what happens when I click back on Live View. So the spacing that was masquerading as a border goes away and the other tables down below are still sort of facing those spacing issues, if you will. So what we are going to do is we are going to get rid of that cell spacing, but we are going to do it by applying borders to our table.

That's another way to sort of get rid of the default cell spacing that we are encountering here. So I am going to get and get rid of that cell spacing attribute, safe the file, and I am going to set up the workspace similar to what we had before. I am going to collapse my icons down, I am going to make sure that I am in Live View on the Design View and then over here I am going to switch to my main.css and I want to make sure I have enough room to see my tables. There we go! So I am going to scroll down to my table styles which are right around line 465 or so and we are going to add our border to couple of different locations.

Now the first thing I want to do is just show you how borders work on tables and then we will refine them. If I go to the table selector and just come in and enter a border in. So I will do border, let's just do 1 pixel, solid border, and we will just do black so we can see what that would look like. So I am going to go ahead and Save this and now when I click back on my Tables, notice what happens. It might not be what you were expecting. You will notice for example that what we have here is we have this sort of black line that goes all the way around. Well, actually it's doing exactly what we told it to do.

We told it to apply a black border all the way around the ends of the table which is exactly what it's doing. So if we wanted to have a border inside the table, then we need to address that with the th and tds in our table. So with these two guys right here, I am going to come in and apply another border to them and we will do the same border; 1 pixel, solid, black. Save that and now I want to click back on my file, well, that doesn't look at all like I was expecting it to look.

What we are getting here is we are still getting that cell spacing gone on and then you can see that the border is going around each of the individual table cells. Now if the cell spacing wasn't there, if we had set cell spacing to 0, these tables cell spacing would collapse, but the borders wouldn't. So we would end up with a 2 pixel wide border instead. Well, there is very easy fix for this entire mess. All I have to do is go up to my table selector and I use a property that's not accessible to us in the CSS rule definition dialog box, which is one reason why we're coding this by hand actually and I am just going to click on the next line and I am going to enter the border-collapse property and I am going to tell it to collapse.

Now what that means is as if two borders are touching, instead of honoring both their values and having a totally cumulative border of two pixels it's going to collapse down and take the larger of the two values. So now if I save this, click back inside, you can see what that does. It collapses those table cells, the cell spacing is eliminated and now I am left with a 1 pixel black border all the way around it. That doesn't actually look that bad. I kind of like that. However, I want to try to do something a little bit more custom. What if we did a border where we had a white divider between the headers in the table cells and then just another white divider that divides the two columns together? Well, doing something like that, a custom border like that, becomes a little bit more tricky.

So let's take a look at how we would do that. The first thing I want to do is I want to go back to my table selector and I am going to change the border that I have applied here. I am going to change this to 3 pixels because I am going to make it little bit larger and I am going to change it to white. Now you might say to yourself, but wait a second, why would you have a white border all the way around the outside of the table, the background is white? Exactly! So what that's going to do for me is it is going to make this tables look a little tiny bit smaller, but when I have borders here, that sort of come together, basically this line in the outside is going to blend in with them and you are not going to see this white line jutting out, if you would.

If would look really jagged if I didn't do that. I am going to scroll down and I need to take the border off of the th and the tds, because we need to customize this so that the table headers are getting one border and then the table cells are going to be getting a different flavor of the border. So I am going to go up to the th selector which is just above that and for that I am going to do a border-bottom. I am only going to apply a border to the bottom of the table header cells and I am going to use the same border 3 pixels solid and white.

I will save that and now if I click over on my tables you can see what this does for us, it gives us a nice little separator between our table headers and the cells themselves. Now we've could also used margins to do that for us since we have a white background. But that means that if these table appear anywhere else or if I change the background color of the article, I'll still have that white space regardless of what the background color of the article is. Then finally I am going to go to my table data cells, but what I am going to do is I am going to come down to the td, th selector. So this one right here, the one we just took the border off of.

What I am going to do is I am going to come in here and create a new line. I am just going to do border-left and I am going to do a left border of 3 pixels solid and white. Now you know why we have a border all the way around the outside of the table, because each table cell is going to have a 3 pixel left border on it, but not one on the right-hand side. So I would have an offset over here if I didn't have this white border all the way around that. I am going to go ahead and save this and now when I click back into my tables you can see that now we have this custom border where it looks like there is little bit of margins or spacing going on here, but in reality we are just using custom borders to achieve the same effect and you can see it because we have multiple tables on there, each one of them are getting the styling.

Now even though our table is extremely simple we've spent a great deal of care in properly structuring and styling in it. As your tables get more complex, you'll want to pay even closer attention to a structure and if you've never worked with them before you should learn about additional table structural elements like thead and tbody that can help structure complex table data.

There are currently no FAQs about Dreamweaver CS6 Essential Training.

 
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.
Upgrade now


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 Upgrade now

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 CS6 Essential Training.

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

Notes cannot be added for locked videos.

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.