+
+ if (csv->captions)
+ csv_output_table_item_text (csv, table_item_get_caption (table_item),
+ "Caption");
+
+ const struct footnote **f;
+ size_t n_footnotes = table_collect_footnotes (table_item, &f);
+ if (n_footnotes)
+ {
+ fputs ("\nFootnotes:\n", csv->file);
+
+ for (size_t i = 0; i < n_footnotes; i++)
+ if (f[i])
+ {
+ csv_output_field (csv, f[i]->marker);
+ fputs (csv->separator, csv->file);
+ csv_output_field (csv, f[i]->content);
+ putc ('\n', csv->file);
+ }
+
+ free (f);
+ }