Edit the layout.
NOTE: Unless your list has columns called Location, Department, YearsOfService, etc., the default custom layout will not work for you and MUST be changed.
By default, the layout code looks like this (38 lines):
The main area to note is highlighted in yellow above. It includes two nested TABLE tags (table 1 starts on line 5 and the nested table starts on line 14; see the yellow highlight above). These tables look like the diagram shown here. The outside table (table 1, shown with red lines) has one row (<TR>) with two columns (<TD>). The inner table (shown with green lines) is inside the second column of the first table and has several rows with two columns each.
Most layouts will have at least one table where you will display values from the columns of the list you want to rotate. Sometimes you may want to include column labels, as seen in the default layout above.
The custom layout we will build for the Announcements list has a different table structure. We don’t plan to include column labels, so the table is just 4 rows and two columns (the first two rows spans both columns).
To implement the custom layout for the Announcements list shown at the top of the page, replace the outer <TABLE> tag in the default layout (lines 5 though 35) with the one shown below (HW21-AnnouncementsLayoutTableTagExample).
Notice the code highlighted in yellow and purple. The yellow highlights show code needed to display the value of a particular column of the list. For example, the tag:
will display the value of the Title column. The tag:
will display the value of the Body column. You can use this syntax to display the value of any column with a name that doesn’t have any spaces in the name. If you have a column name with spaces (i.e., “Years of Service”), the tag will be:
where _x0020_ replaces any spaces.
The code highlighted in purple is the CSS class which controls the font, size, color, etc. of the display. See Step 6 below for more information.
Finally, notice the width of each column (<TD>) in the ninth and tenth rows is specified as:
The first column is not as wide as the second to show the Announcement Body indented below the Announcement Title.