Markdown plugin table bug

Hello @mrtmm, I saw this thread but I can’t reply to it since it’s closed. It looks like this bug is still open. I’ve been using raw HTML tables to work around it, but it’d be great if that could be fixed.

Hi @Rohan, I haven’t had bandwidth to dig into this much more but by a quick look, I think the tables are doing the right thing, as explained here: tables · trentm/python-markdown2 Wiki · GitHub
I think what is missing is any sort of styling, right?
Are you adding some CSS classes to your raw HTML tables? Are you using the comprehensive theming? Or perhaps a custom brand repository for the Learning MFE?

The div holding the markdown block in the LMS will have a class markdown_xblock, you could use that as a selector for your stylesheet in your brand/theme and add some styling to your tables. For example:

.markdown_xblock {
    table {
        width: 100%;
    }
    table, th, td {
        border: 1px solid;
    }
}

You can also add existing/custom CSS classes to the XBlock via the Classes setting; in Studio this is under the Settings tab when your markdown editor is open.

Is this something that you could try?

Hi @Rohan! I’ve created a PR to add some default styling to tables and match them with the current raw HTML block tables. Of course, anyone can still add their own styling via theme/brand.

Mind you, I’m no CSS expert so It’d be great help if you could test it and let us know if this aligns with what you were looking for.

Thanks!

Tested this after I installed tag 1.2.0, and it looks good!

1 Like