tables support #556
Replies: 3 comments 2 replies
-
Rendering tables is technically possible by the widget used for the document viewer, but unless you use a fixed width font in the editor, it is difficult to generate a table with markdown syntax that is readable in both panels. I do see the value in having simple tables in the notes, and I do make them myself. But you can achieve simple tables by just using the tab key and hard line breaks. A while back I added a hack that ensures that tabs are properly rendered also in the document viewer (HTML generally doesn't support tabs), so aligning text with tabs is thus readable in both the editor and the viewer. Hard line breaks in markdown are achieved by leaving two spaces at the end of the line, which novelWriter also supports. This is needed to separate rows in such a table. |
Beta Was this translation helpful? Give feedback.
-
Yes, this is quite usable. Unfortunately, I happen to need something like this (i.e. rows of unequal height). |
Beta Was this translation helpful? Give feedback.
-
I see. Well, you can still do this with tabs, with the benefit of having a readable table in both editor and viewer with a variable width font. While writing a parser for markdown tables, especially in a simplified form, the recursive parsing nature of a table doesn't fit with the parsing pipeline used in novelWriter, so it will have to be rewritten. That is a fairly big job. The parser is written in a linear way because I decided early on not to include complex structures like tables, and stick to minimal formatting features. This makes the parser both faster and easier to subclass to produce multiple output formats. Full markdown parsers are notoriously convoluted due to the nature of the markdown spec. I felt this wasn't needed for writing fiction. I suppose I could add a simplified table support where the Still, I'm concerned about the readability of this. These kind of data structures are generally better suited for spread sheet type documents. It may actually be a better idea to add a new type of document that can be added to a project. For instance a table document. No formula support, just text in cells. Qt5 already has such a widget, so it's just a matter of defining a format to save the data and adding an editor window for it. Another alternative is to move forward with the earlier idea of allowing attaching external files to notes. |
Beta Was this translation helpful? Give feedback.
-
Hi,
Is there any possibility for tables support? Nothing too fancy just simple rows and columns. I need it for a plot summary that takes place in the present and in the past.
Beta Was this translation helpful? Give feedback.
All reactions