4e5e4b111651337ddd7d36320f1f667d6c035788
kate
  Tue Jan 28 14:46:42 2014 -0800
1. Bug fix: need section on details page for peak clusters lacking motif.  2. Some code simplification. refs #9092
diff --git src/hg/lib/web.c src/hg/lib/web.c
index 005bd40..c0b10e9 100644
--- src/hg/lib/web.c
+++ src/hg/lib/web.c
@@ -345,79 +345,90 @@
 va_end(args);
 }
 
 void webStartHeader(struct cart *theCart, char *db, char *headerText, char *format, ...)
 /* Print out pretty wrapper around things when not from cart.
  * Include headerText in the html header. */
 {
 va_list args;
 va_start(args, format);
 webStartWrapperGatewayHeader(theCart, db, headerText, format, args, TRUE, TRUE,
 			     FALSE);
 va_end(args);
 }
 
 
-static void webEndSection()
+void webEndSection()
 /* Close down a section */
 {
 puts(
     "" "\n"
     "	</TD><TD WIDTH=15></TD></TR></TABLE>" "\n"
 //    "<BR>"
     "	</TD></TR></TABLE>" "\n"
     "	</TD></TR></TABLE>" "\n"
     "	" );
 puts("</div>");
 }
 
-void webNewSectionHeaderStart()
-/* Start the header for a new section on the web page */
+void webNewSectionHeaderStart(boolean hasTitle)
+/* Start the header for a new section on the web page.
+ * May be used to maintain table layout without a proper section header */
 {
 webEndSection();
 puts("<div>");
 puts("<!-- +++++++++++++++++++++ START NEW SECTION +++++++++++++++++++ -->");
 puts(  // TODO: Replace nested tables with CSS (difficulty is that tables are closed elsewhere)
     "<BR>\n\n"
     "   <!--outer table is for border purposes-->\n"
     "   <TABLE WIDTH='100%' BGCOLOR='#" HG_COL_BORDER
         "' BORDER='0' CELLSPACING='0' CELLPADDING='1'><TR><TD>\n"
     "    <TABLE BGCOLOR='#" HG_COL_INSIDE
-         "' WIDTH='100%'  BORDER='0' CELLSPACING='0' CELLPADDING='0'><TR><TD>\n"
-    "     <div class='subheadingBar' class='windowSize'>");
+         "' WIDTH='100%'  BORDER='0' CELLSPACING='0' CELLPADDING='0'><TR><TD>\n");
+if (hasTitle)
+    puts("<div class='subheadingBar' class='windowSize'>");
+else
+    puts("<div>");
 }
 
 void webNewSectionHeaderEnd()
 /* Properly close header of collapsible section on web page */
 {
 puts("     </div>\n"
      "     <TABLE BGCOLOR='#" HG_COL_INSIDE "' WIDTH='100%' CELLPADDING=0>"
           "<TR><TH HEIGHT=10></TH></TR>\n"
      "     <TR><TD WIDTH=10>&nbsp;</TD><TD>\n\n");
 }
 
 void webNewSection(char* format, ...)
 /* create a new section on the web page */
 {
 va_list args;
 va_start(args, format);
-webNewSectionHeaderStart();
+webNewSectionHeaderStart(TRUE);
 vprintf(format, args);
 webNewSectionHeaderEnd();
 va_end(args);
 }
 
+void webNewEmptySection()
+/* create a new section on the web page to maintain table layout */
+{
+webNewSectionHeaderStart(FALSE);
+webNewSectionHeaderEnd();
+}
+
 void webEndSectionTables()
 /* Finish with section tables (but don't do /BODY /HTML like
  * webEnd does. */
 {
 webEndSection();
 puts("</TD></TR></TABLE>\n");
 }
 
 void webEnd()
 /* output the footer of the HTML page */
 {
 if(!webInTextMode)
     {
     webEndSectionTables();
 #ifndef GBROWSE