NicoNekoru / obsidan-advanced-table-xt

Plugin that adds features to tables in obsidian including merging, vertical headers, and custom css
Apache License 2.0
91 stars 3 forks source link

[Question] What am i doing wrong? #57

Closed HippyCraig closed 5 months ago

HippyCraig commented 6 months ago

So I am trying to get this to work The bottom row should merge each cell up to the second to last row here. The first column merges fine when there is no text in the cell but if I have any kind of text to merge up as in the PRO area I wanted the two rows to combine but thats not working.

I have a CSS file that I use with the class .ccg-work-table-settings but its not picking that up either.

What am I doing wrong here?

(imagine 3 ticks) sheet
--- ~ {.ccg-work-table-settings}
| Env | Account              | Type    | Link |
| --- | -------------------- | ------- | ---- |
| Dev | Domain\\Some Account | AD      | Link |
| ^   | Domain\\Some Account | AD      | Link | 
| QA  | Domain\\Some Account | AD      | Link | 
| ^   | Domain\\Some Account | AD      | Link | 
| PRO | Domain\\Some Account | AD      | Link | 
| ^   | ^ Domain\\Some Account | ^ Sybase  | ^ Link | 
(imagine 3 ticks)

Even if I take off the merge commands but leave the style in place it still doesnt work, I do get this:

image

NicoNekoru commented 5 months ago

If you use the --- delimeter, the plugin assumes that there is some json metadata. For your use case, you can simply pass an empty json like so:

```sheet
{}
--- ~ {.ccg-work-table-settings}
| Env | Account              | Type    | Link |
| --- | -------------------- | ------- | ---- |
| Dev | Domain\\Some Account | AD      | Link |
| ^   | Domain\\Some Account | AD      | Link | 
| QA  | Domain\\Some Account | AD      | Link | 
| ^   | Domain\\Some Account | AD      | Link | 
| PRO | Domain\\Some Account | AD      | Link | 
| ^   | ^ Domain\\Some Account | ^ Sybase  | ^ Link | 
HippyCraig commented 5 months ago

ok I will give that a try, is there a better way to do what Im asking? some ohter type of code block format?

Also what about the last line in the table that doesnt seem to work iwth merging up in my sistuation

NicoNekoru commented 5 months ago

To apply a style to the whole table, what you are doing is the best option.

For the last line what are you trying to do with merging? It is working as expected for me. image image

If you are expecting the cells ^ Domain\\Some Account, ^ Sybase, and ^ Link to merge, think about what the implications of merging a cell with content is. Try that action in some spreadsheet app.

HippyCraig commented 4 months ago

Thanks for getting back to me and sorry for the late reply.

HippyCraig commented 3 months ago

I just started back on testing this and Im not sure my style sheet is taking effect.

{}
--- ~ {.ccg-work-table-settings}
| Env | Account              | Type    | Link |
| --- | -------------------- | ------- | ---- |
| Dev | Domain\\Some Account | AD      | Link |
| ^   | Domain\\Some Account | AD      | Link | 
| QA  | Domain\\Some Account | AD      | Link | 
| ^   | Domain\\Some Account | AD      | Link | 
| PRO | Domain\\Some Account | AD      | Link | 
| ^   |  Domain\\Some Account |  Sybase  |  Link | 

When looking at the read view and looking at the chrome dev tools I do not see my style sheet being applied. I would also like to pass along some style info into the class as follows not sure if this changes how this works but I tried both and neither did

--- ~ {.ccg-work-table-settings} --- ~ {.ccg-work-table-settings style="--SOMEVARIABLE = COLOR}

Aside from this is there a way to merge a whole row with the one above. I was think about it and if there is a way, I can make the table easier to read with sepereate rows but just merge the whole row with the one above. I know I can put that data in the cell above with a \<br\/> (HTLM line break) but that makes teh line very long and hard to modify, it could make the source easier to read and modify.

I will move this to a new ticket and refrence this one.