-/* Set headers. */
-void table_set_hl (struct table *, int hl);
-void table_set_hr (struct table *, int hr);
-void table_set_ht (struct table *, int ht);
-void table_set_hb (struct table *, int hb);
-\f
-/* Table classes. */
-
-/* Simple kinds of tables. */
-struct table *table_from_string (unsigned int options, const char *);
-struct table *table_from_variables (unsigned int options,
- struct variable **, size_t);
-struct table *table_from_casereader (const struct casereader *,
- size_t column,
- const char *heading,
- const struct fmt_spec *);
-
-/* Combining tables. */
-struct table *table_paste (struct table *, struct table *,
- enum table_axis orientation);
-struct table *table_hpaste (struct table *left, struct table *right);
-struct table *table_vpaste (struct table *top, struct table *bottom);
-
-/* Taking subsets of tables. */
-struct table *table_select (struct table *, int rect[TABLE_N_AXES][2]);
-struct table *table_select_slice (struct table *, enum table_axis,
- int z0, int z1, bool add_headers);
-struct table *table_select_columns (struct table *,
- int x0, int x1, bool add_headers);
-struct table *table_select_rows (struct table *,
- int y0, int y1, bool add_headers);
-
-/* Miscellaneous table operations. */
-struct table *table_transpose (struct table *);
+/* Simple kinds of output. */
+struct table *table_from_string (const char *);
+void table_output_text (int options, const char *string);
+void table_output_text_format (int options, const char *, ...)
+ PRINTF_FORMAT (2, 3);
+
+/* Rule masks. */
+#define TAB_RULE_TYPE_MASK 7
+#define TAB_RULE_TYPE_SHIFT 0
+#define TAB_RULE_STYLE_MASK (31 << TAB_RULE_STYLE_SHIFT)
+#define TAB_RULE_STYLE_SHIFT 3
+
+/* Tables. */
+struct table *table_create (int nc, int nr, int hl, int hr, int ht, int hb);
+
+/* Rules. */
+void table_hline (struct table *, int style, int x1, int x2, int y);
+void table_vline (struct table *, int style, int x, int y1, int y2);
+void table_box (struct table *, int f_h, int f_v, int i_h, int i_v,
+ int x1, int y1, int x2, int y2);
+
+/* Cells. */
+void table_text (struct table *, int c, int r, unsigned opt, const char *);
+void table_text_format (struct table *, int c, int r, unsigned opt,
+ const char *, ...)
+ PRINTF_FORMAT (5, 6);
+void table_joint_text (struct table *, int x1, int y1, int x2, int y2,
+ unsigned opt, const char *);
+
+void table_add_subscripts (struct table *, int x, int y,
+ char **subscripts, size_t n_subscripts);
+void table_add_superscript (struct table *, int x, int y,
+ const char *superscript);
+
+/* Footnotes.
+
+ Use table_create_footnote() to create the footnotes themselves, then use
+ table_add_footnote() to create a reference from a table cell to a footnote.
+ There are two steps because a footnote may have multiple references. */
+struct footnote *table_create_footnote (struct table *, size_t idx,
+ const char *content,
+ const char *marker,
+ struct table_area_style *);
+void table_add_footnote (struct table *, int x, int y,
+ const struct footnote *);
+
+void table_add_style (struct table *, int x, int y,
+ const struct table_area_style *);
+
+bool table_cell_is_empty (const struct table *, int c, int r);