- if (cell.style->cell_style.valign != TABLE_VALIGN_TOP)
- {
- put_style (&style, "vertical-align",
- (cell.style->cell_style.valign == TABLE_VALIGN_BOTTOM
- ? "bottom" : "middle"));
- }
-
- const struct font_style *fs = &cell.style->font_style;
- char bgcolor[32];
- if (format_color (fs->bg[y % 2],
- (struct cell_color) CELL_COLOR_WHITE,
- bgcolor, sizeof bgcolor))
- put_style (&style, "background", bgcolor);
-
- char fgcolor[32];
- if (format_color (fs->fg[y % 2],
- (struct cell_color) CELL_COLOR_BLACK,
- fgcolor, sizeof fgcolor))
- put_style (&style, "color", fgcolor);
-
- if (fs->typeface)
- {
- put_style (&style, "font-family", "\"");
- escape_string (html->file, fs->typeface, " ", "\n");
- putc ('"', html->file);
- }
- if (fs->bold)
- put_style (&style, "font-weight", "bold");
- if (fs->italic)
- put_style (&style, "font-style", "italic");
- if (fs->underline)
- put_style (&style, "text-decoration", "underline");
- if (fs->size)
- {
- char buf[32];
- snprintf (buf, sizeof buf, "%dpt", fs->size);
- put_style (&style, "font-size", buf);
- }
-
- int colspan = table_cell_colspan (&cell);
- int rowspan = table_cell_rowspan (&cell);
-
- if (html->borders)
- {
- /* Cell borders. */
- struct cell_color color;
-
- int top = table_get_rule (t, TABLE_VERT, x, y, &color);
- put_border (&style, top, &color, "top");
-
- if (y + rowspan == t->n[V])
- {
- int bottom = table_get_rule (t, TABLE_VERT, x, y + rowspan,
- &color);
- put_border (&style, bottom, &color, "bottom");
- }
-
- int left = table_get_rule (t, TABLE_HORZ, x, y, &color);
- put_border (&style, left, &color, "left");