ONLINEPDFPROOFING.COM

photo proofing service - www.onlinepdfproofing.com

Menu


[View full size image]   That's it! You've effectively created a table-based structure for your site using the Layout


mode. Importing Tabular Data Earlier in the chapter, we built a table in the index.htm file to hold the company events. Remember that we created a table with 5 rows and 3 columns and then manually added an icon, a few company events, and a time for each event. In a real-world situation, however, it's safe to say that the process of adding company events would be much more dynamic than a web developer manually adding company events to a table in the organization's main web page. There are numerous options for making this solution more dynamic. One solution, using a database to feed company events to a table on the main page, is discussed in Part V, "Dynamic Web Page Creation." For now, let's discuss a simple alternative: the Import Tabular Data feature, available from Dreamweaver's Insert menu. The Import Tabular Data option, available from the Table Objects submenu in the Insert menu, allows you to quickly build an HTML table based on preformatted tab-, comma-, semicolon-, or colon-delimited files. What this means is that Herbert over in HR can maintain a spreadsheet of company events. When he's ready to have a set of new events posted on the website, he can export his spreadsheet to one of the delimited options, and then send it to you for quick import using the Import Tabular Data feature. For our example, we'll use a tab-delimited file located in the Assets folder called companyevents.txt. Opening the file reveals that the text in the file is in fact separated by tabs similar to Figure 6.49. Figure 6.60. A tab-delimited file contains text separated by tabs. [View full size image]   Dreamweaver, recognizing that the file is separated by tabs will pick apart all text elements in this file and place them into their own cells in a new table. To see this feature for yourself, first open index.htm, remove the existing company events table (leave your cursor in the cell), and choose Insert, Table Object, Import Tabular Data. The Import Tabular Data dialog appears (see Figure 6.50). Figure 6.50. The Import Tabular Data dialog allows you to import a file based on a delimiter option and then format the table that will be created for the content.   Notice that the Import tabular Data dialog contains options for importing the file to use, choosing a delimiter option, and formatting the table that will be created for the content. The complete list of functionality exposed by the dialog is outlined here: Data file: Click the Browse button next to this field to look for and select the file to use. For our example, browse to the companyevents.txt file located in the Assets folder. Delimiter: Choose a delimiter option. Options include Tab, Comma, Semicolon, Colon, and Other. Choosing Other enables a text box allowing you to type in the delimiter symbol. For our example, choose Tab. Table width: Choose the Fit to Data radio button to have the newly generated table added to the page with no widths specified. Because no widths will be specified, the table will be as wide as the longest text element in the cells. You can also choose the Set option to specify a width in either pixels or percent manually. For example, choose the Set To radio button, type the value 100 in the text box, and choose the Percent option from the menu.