Witten
Bainbridge
Nichols
HOME HELP PREFERENCES SEARCHFIGURESTABLES

Adding header information to a VList

 1 package document
 2
 3 _pagescriptextra_ {
 4   function createVListth(content)
 5   \{
 6      var th = document.createElement("th");
 7      th.setAttribute("class","vlistheading");
 8
 9      th.innerHTML = content;
10
11      return th;
12   \}
13
14   function manipulateVList()
15   \{
16      var vlistTable = document.getElementById("group\_top");
17      var tbody = vlistTable.firstChild;
18
19      if (tbody.nodeName == "#text") \{
20        // cope with Firefox/IE difference
21        tbody = tbody.nextSibling;
22      \}
23
24      var firsttr       = tbody.firstChild;
25      var thIcon        = createVListth("");
26      var thTitle       = createVListth("Title:");
27      var thSubject     = createVListth("Subject:");
28      var thDescription = createVListth("Description:");
29
30      var newtr = document.createElement("tr");
31      newtr.appendChild(thIcon);
32      newtr.appendChild(thTitle);
33      newtr.appendChild(thSubject);
34      newtr.appendChild(thDescription);
35
36      tbody.insertBefore(newtr,firsttr);
37   \}
38 }
39
40 _pagefooterextra_ {
41     <script type="text/javascript">
42         _If_(_cgiargcl_,manipulateVList();)
43     </script>
44 }

Figure 12.7b: Adding header information to a VList; Macro file, including JavaScript