Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tables #13

Closed
mroughan opened this issue Jun 16, 2020 · 5 comments
Closed

Tables #13

mroughan opened this issue Jun 16, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@mroughan
Copy link

I haven't been able to find a way to add a table to a question?

@gpoore
Copy link
Owner

gpoore commented Jun 16, 2020

You should be able to use tables like this: https://python-markdown.github.io/extensions/tables/.

More advanced tables are probably possible, but would require using a Python-Markdown extension beyond what is included in Python-Markdown itself.

@mroughan
Copy link
Author

When I tried it, I could get the text of the table into Canvas, but the table wasn't parsed as such. It just came out as one long string of text. Maybe there is something I need to do with indentation?

@dragonxtek
Copy link

remember that you can also use tables in html

@gpoore
Copy link
Owner

gpoore commented Jun 16, 2020

I've investigated further, and there are a couple of different issues.

Tables are working (if you are using text2qti v0.2.0 or later), but by default Canvas doesn't use borders for tables (at least for me), so depending on what you are doing, tables don't necessarily look that good. In the last commit (dev version), I've enabled Markdown in HTML, so you can now do something like this to put a box around the entire table:

1.  <div markdown="1" style="border: 1px solid black; display: inline-block;">

    First Header  | Second Header
    ------------- | -------------
    Content Cell  | Content Cell
    Content Cell  | Content Cell

    </div>

    More text

*a) True
b)  False

Depending on what you are doing, that may be an improvement. However, there isn't a way to modify the table HTML itself without actually writing out the HTML. Python-Markdown doesn't seem to supply an easy way to modify tag attributes for things like tables.

@gpoore gpoore added the enhancement New feature or request label Jun 16, 2020
@mroughan
Copy link
Author

I can use HTML if needed. The plan is to autogenerate the txt files eventually so HTML isn't much harder than markdown for the occasional table. I just hadn't realized I could insert HTML in there.

@gpoore gpoore closed this as completed Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants