+ int left = table_get_rule (t, TABLE_HORZ, x, y, &color);
+ put_border (style, left, "left");
+
+ if (x + colspan == table_nc (t))
+ {
+ int right = table_get_rule (t, TABLE_HORZ, x + colspan, y,
+ &color);
+ put_border (style, right, "right");
+ }
+ }
+ style_end (style);
+
+ if (colspan > 1)
+ fprintf (html->file, " colspan=\"%d\"", colspan);
+
+ if (rowspan > 1)
+ fprintf (html->file, " rowspan=\"%d\"", rowspan);
+
+ putc ('>', html->file);
+
+ /* Output cell contents. */
+ const char *s = cell.text;
+ if (cell.options & TAB_FIX)
+ escape_tag (html->file, "tt", s, " ", "<br>");
+ else
+ {
+ s += strspn (s, CC_SPACES);
+ escape_string (html->file, s, " ", "<br>");
+ }
+
+ if (cell.n_subscripts)
+ {
+ fputs ("<sub>", html->file);
+ for (size_t i = 0; i < cell.n_subscripts; i++)
+ {
+ if (i)
+ putc (',', html->file);
+ escape_string (html->file, cell.subscripts[i],
+ " ", "<br>");
+ }
+ fputs ("</sub>", html->file);
+ }
+ if (cell.superscript)
+ escape_tag (html->file, "sup", cell.superscript, " ", "<br>");
+ html_put_footnote_markers (html, cell.footnotes, cell.n_footnotes);
+
+ /* output </th> or </td>. */
+ fprintf (html->file, "</%s>\n", tag);
+
+ next_1:
+ x = cell.d[TABLE_HORZ][1];
+ }
+ fputs ("</tr>\n", html->file);
+ }
+
+ fputs ("</tbody>\n", html->file);
+ fputs ("</table>\n\n", html->file);
+}
+
+struct output_driver_factory html_driver_factory =
+ { "html", "pspp.html", html_create };
+
+static const struct output_driver_class html_driver_class =
+ {
+ "html",
+ html_destroy,
+ html_submit,