8fc6f5ebc52507e22e78d50b8ae9b400926f3153
angie
  Wed Jan 26 15:25:27 2011 -0800
hgTables' schema page displays the SQL type of each column, whichcan be a very long unbroken string when the column is an enum or
set with many values.  That makes the HTML table painfully wide.
So when the SQL type contains single-quoted comma-separated items,
add a space after each comma so that the HTML cell can break the
list into multiple lines to maintain a reasonable width.

diff --git src/hg/hgTables/schema.c src/hg/hgTables/schema.c
index ebb2126..e03f9b4 100644
--- src/hg/hgTables/schema.c
+++ src/hg/hgTables/schema.c
@@ -108,30 +108,38 @@
 while ((row = sqlNextRow(sr)) != NULL)
     {
     if (showItemRgb && (sameWord(row[0],"reserved")))
 	hPrintf("<TR><TD><TT>itemRgb</TT></TD> ");
     else
 	hPrintf("<TR><TD><TT>%s</TT></TD> ", row[0]);
     if (exampleList != NULL)
         {
 	hPrintf("<TD>");
 	if (example != NULL)
 	     hPrintf("%s", cleanExample(example->name));
 	else
 	     hPrintf("n/a");
 	hPrintf("</TD>");
 	}
+    // enums/sets with many items can make for painfully wide rows in the table --
+    // add spaces between quoted list values:
+    if (stringIn("','", row[1]))
+	{
+	struct dyString *spaced = dyStringSub(row[1], "','", "', '");
+	hPrintf("<TD><TT>%s</TT></TD>", spaced->string);
+	}
+    else
     hPrintf("<TD><TT>%s</TT></TD>", row[1]);
     if (!tooBig)
 	{
 	hPrintf(" <TD>");
 	if ((isSqlStringType(row[1]) && !sameString(row[1], "longblob")) ||
 	    isSqlEnumType(row[1]) || isSqlSetType(row[1]))
 	    {
 	    hPrintf("<A HREF=\"%s", getScriptName());
 	    hPrintf("?%s", cartSidUrlString(cart));
 	    hPrintf("&%s=%s", hgtaDatabase, db);
 	    hPrintf("&%s=%s", hgtaHistoTable, table);
 	    hPrintf("&%s=%s", hgtaDoValueHistogram, row[0]);
 	    hPrintf("\">");
 	    hPrintf("values");
 	    hPrintf("</A>");