A first step towards Table / spreadsheet functionality.
For me personally this would be enough as far as tables go. Databases like Notion or speadsheets like Excel are certainly powerful, but there is a reason those apps have hundreds of developers implementing only this. Data aggregation can (and should?) be done with queries. You could even argue that this is how it should be: Each cell is a single rem which can be referenced separately (as opposed to having the whole table in one rem).
The only thing missing for RemNote (AFAIK this is the same power level as roam tables?) is more powerful flash card generation. This could be done with more powerful flashcard generation (similar to #Extra Card Detail
) or using Queue Plugins in the future.
How it looks at the moment
Rendered Table and corresponding rem:
Generated flash cards for a cell
CSS
See What is Custom CSS and how do I use it?
This is not yet polished enough to put on the Library but since many people asking for table visuals I’ll put the CSS here anyway. Maybe someone else can even improve the code
.tree-node-container[data-rem-container-tags~=column-table] > .TreeNode > .tree-node-container {
border: 1px solid black;
}
/* fix collapsing borders */
.tree-node-container[data-rem-container-tags~=column-table] > .TreeNode > .tree-node-container:nth-child(n+2) {
border-left: unset;
margin-left: -1px;
}
/* remove indentation marker */
.tree-node-container[data-rem-container-tags~=column-table] .TreeNode {
border-left: unset !important;
}
.tree-node-container[data-rem-container-tags~=column-table] > .TreeNode > .tree-node-container > div:first-child {
border-bottom: 1px solid black;
font-weight: bold;
background-color: rgba(0,0,0,0.05);
}
.tree-node-container[data-rem-container-tags~=column-table] > .TreeNode > .tree-node-container > .TreeNode > .tree-node-container > div:first-child:not(:focus-within) .descriptor_rem_type,
.tree-node-container[data-rem-container-tags~=column-table] > .TreeNode > .tree-node-container > .TreeNode > .tree-node-container > div:first-child:not(:focus-within) .separator-symbol {
display: none;
}
#hierarchy-editor .tree-node-container[data-rem-container-tags~=column-table] > .TreeNode > .tree-node-container > .TreeNode {
margin-left: 0;
padding-left: 0;
}
.tree-node-container[data-rem-container-tags~=column-table] > .TreeNode:not(:hover) .rem-bullet__container {
visibility: hidden;
}
.tree-node-container[data-rem-container-tags~=column-table] > .TreeNode {
display: grid;
/* auto jumps when toggling/writing rems */
/* grid-template-columns: auto auto auto; */
grid-auto-columns: 1fr;
}
.tree-node-container[data-rem-container-tags~=column-table] > .TreeNode > .tree-node-container:nth-of-type(1) {
grid-column: 1;
}
.tree-node-container[data-rem-container-tags~=column-table] > .TreeNode > .tree-node-container:nth-of-type(2) {
grid-column: 2;
}
.tree-node-container[data-rem-container-tags~=column-table] > .TreeNode > .tree-node-container:nth-of-type(3) {
grid-column: 3;
}
.tree-node-container[data-rem-container-tags~=column-table] > .TreeNode > .tree-node-container:nth-of-type(4) {
grid-column: 4;
}
.tree-node-container[data-rem-container-tags~=column-table] > .TreeNode > .tree-node-container:nth-of-type(5) {
grid-column: 5;
}
.tree-node-container[data-rem-container-tags~=column-table] > .TreeNode > .tree-node-container:nth-of-type(6) {
grid-column: 6;
}
Content to generate the table
- Column Table
- Thing template
- Property 1
- Property 2
- First
- Property 1:: value 1
- Property 2:: value 2
- Second
- Property 1:: value 3
- Property 2:: value 4
Property 1
and Property 2
should/could be slots.
TODO
These things are unfinished in particular:
- I did not explore all flashcard possibilities yet. E.g. it might be nice when practicing to have multilines as columns to practice a whole column in one go somehow.
- Only multiple lines in a cell break the layout. This could be solved with row tables (fixed column width).
- Maybe use flexbox instead of grid. (I had experimented with this when making the original demos and it is sometimes more better.)
- (Option to) hide tags.
- Style first column if it is the template (maybe use extra tag).
- Make it easier to follow lines, e.g. alternate colors or borders.
- Compatibility with bullet point changing CSS (tskn theme) and Rem Type and Practice Direction icons.