Output table header to console and csv file (if present).

def write_headers(self):
        """
        Output table header to console and csv file (if present).
        """
        h1 = []
        h2 = []
        for m in self.values():
            h2.append(m.render_subtitle())
            h1.append(m.render_title())

        stdout.write(" ".join(h1))
        stdout.write("\n\r")
        c = _ansi["gray"] + "|" + _ansi["reset"]
        stdout.write(c.join(h2))
        stdout.write("\n\r")
        stdout.flush()

        if self._csvfile:
            header_row = []
            for m in self.values():
                if isinstance(m, MultiMetric):
                    for subm in m.values():
                        header_row.append(
                            "{}_{}".format(m.title, subm.title)
                        )
                else:
                    if m.subtitle:
                        header_row.append(
                            "{}_{}".format(m.title, m.subtitle)
                        )
                    else:
                        header_row.append(m.title)
            self._write_csv_row(header_row, rewrite=True)