#include "libpspp/i18n.h"
#include "libpspp/message.h"
#include "libpspp/version.h"
+#ifdef HAVE_CAIRO
#include "output/cairo-chart.h"
+#endif
#include "output/chart-item.h"
#include "output/driver-provider.h"
#include "output/message-item.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
+/* This file uses TABLE_HORZ and TABLE_VERT enough to warrant abbreviating. */
+#define H TABLE_HORZ
+#define V TABLE_VERT
+
struct html_driver
{
struct output_driver driver;
{
fputs ("<tfoot>\n", html->file);
fputs ("<tr>\n", html->file);
- fprintf (html->file, "<td colspan=%d>\n", table_nc (t));
+ fprintf (html->file, "<td colspan=%d>\n", t->n[H]);
*tfoot = true;
}
else
bool tfoot = false;
int y;
- fputs ("<table>\n", html->file);
+ fputs ("<table", html->file);
+ if (item->notes)
+ {
+ fputs (" title=\"", html->file);
+ escape_string (html->file, item->notes, " ", "\n");
+ putc ('"', html->file);
+ }
+ fputs (">\n", html->file);
const struct table_item_text *caption = table_item_get_caption (item);
if (caption)
fputs ("<tbody>\n", html->file);
- for (y = 0; y < table_nr (t); y++)
+ for (y = 0; y < t->n[V]; y++)
{
int x;
fputs ("<tr>\n", html->file);
- for (x = 0; x < table_nc (t);)
+ for (x = 0; x < t->n[H];)
{
struct table_cell cell;
const char *tag;
goto next_1;
/* output <td> or <th> tag. */
- bool is_header = (y < table_ht (t)
- || y >= table_nr (t) - table_hb (t)
- || x < table_hl (t)
- || x >= table_nc (t) - table_hr (t));
+ bool is_header = (y < t->h[V][0]
+ || y >= t->n[V] - t->h[V][1]
+ || x < t->h[H][0]
+ || x >= t->n[H] - t->h[H][1]);
tag = is_header ? "th" : "td";
fprintf (html->file, "<%s", tag);
int top = table_get_rule (t, TABLE_VERT, x, y, &color);
put_border (style, top, "top");
- if (y + rowspan == table_nr (t))
+ if (y + rowspan == t->n[V])
{
int bottom = table_get_rule (t, TABLE_VERT, x, y + rowspan,
&color);
int left = table_get_rule (t, TABLE_HORZ, x, y, &color);
put_border (style, left, "left");
- if (x + colspan == table_nc (t))
+ if (x + colspan == t->n[H])
{
int right = table_get_rule (t, TABLE_HORZ, x + colspan, y,
&color);