Dreamweaver MX 2004: The Missing Manual

     

The Web was originally invented to help scientists exchange information, not to compete with the sophisticated design of newspapers, glossy magazines, or TV. Controlling a page's layout remains one of Web design's greatest challenges. The increasing expectations of the Web's users, however, have forced designers to push HTML into new territories , and the primary weapon in this battle has been the HTML <table> tag.

Though originally intended to display tables of data, many Web designers use the <table> tag primarily for arranging elements on a Web page, as shown in Figure 7-1.

Of course, trying to force a round peg into a square hole isn't always easy, and for years , designers had to twist the <table> tag to their own ends, resulting in complex and byte-heavy code that was difficult to update. However, sophisticated browsers like Internet Explorer 5 and 6, Mozilla, Opera, and Safari give designers a wider variety of options. These days, three basic design approaches are the most popular:

  • Strict table-based layouts. This method uses only tables to position elements on the page. Frequently, this old-school approach requires merging cells across rows and columns , nesting tables within tables (a cumbersome technique) and excessive use of table elements just to create margins, gutters, and areas of white space.

  • Tables and Cascading Style Sheets. This combination approach sticks with the seasoned and reliable <table> tag to create basic layout areas, but employs CSS for more sophisticated formatting like margins, whitespace, borders, and backgrounds. This type of design is easier to create and makes for smaller Web files than the table-only method. The tutorial in Section 7.11.3 has an example.

  • Cascading Style Sheets. CSS offers absolute positioning (Section 8.3.1), which means that, in theory, you can abandon tables completely and have total control over layout. Many sites now use CSS only. However, not all browsers display these designs correctly, and those that do don't always display them the same way. In fact, to get this type of design to work accurately, you may find yourself having to resort to as many tricks as with strict table-based layouts.

Fortunately, Dreamweaver MX 2004 provides the tools for creating any of these types of design. In this chapter, you'll learn about Dreamweaver's advanced table tools that let you build beautiful table-based layouts; in the next chapter, you'll learn how to maximize the power of CSS. With these tools ”and this book ”you'll soon be gliding along the path to attractive, effective Web pages. (If you can't wait to get started using Dreamweaver to create advanced layouts, see Section 7.11.3 and follow the tutorial.)

Underneath many Web pages is an invisible skeleton that gives the page form and structure. HTML tables let you control the placement of graphics, text, and other elements on a Web page with accuracy. Without tables, Web contents would simply flow from top to bottom on a page ”boring!

Категории