def to_markdown_str(self) -> str:
        """
        Generates a Markdown string representation of the table.
        """
        column_widths = self._calc_col_widths()
        markdown_str = ""

        # Generate header rows
        if self.headers:
            for header in self.headers:
                header_row = (
                    "| "
                    + " | ".join(
                        cell.content.ljust(width) if cell.content else " " * width
                        for cell, width in zip(header.cells, column_widths)
                    )
                    + " |"
                )
                markdown_str += header_row + "\n"

                separator_row = (
                    "|:" + ":|:".join("-" * width for width in column_widths) + ":|"
                )
                markdown_str += separator_row + "\n"

        # Generate data rows
        for row in self.rows:
            data_row = (
                "| "
                + " | ".join(
                    cell.content.ljust(width) if cell.content else " " * width
                    for cell, width in zip(row.cells, column_widths)
                )
                + " |"
            )
            markdown_str += data_row + "\n"

        return markdown_str.rstrip()

        Generates a Markdown string representation of the table.
        
src/openparse/tables/table_transformers/schemas.py