# Mini Plugin Sheets Basic: Merge Markdown Table Cells

**URL:** <https://forum.obsidian.md/t/mini-plugin-sheets-basic-merge-markdown-table-cells/84520>\
**Category:** Plugins\
**Tags:** plugin-release\
**Created:** [June 30, 2024, 3:47am UTC](https://forum.obsidian.md/t/mini-plugin-sheets-basic-merge-markdown-table-cells/84520 "2024-06-30T03:47:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![PlayerMiller](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/p/aca169/32.png) [@PlayerMiller](https://forum.obsidian.md/u/PlayerMiller)\
**Post date:** [June 30, 2024, 3:47am UTC](https://forum.obsidian.md/t/mini-plugin-sheets-basic-merge-markdown-table-cells/84520/1 "2024-06-30T03:47:08Z")

</div>

> ## Disclaimer
> 
> Is this project **open source**? Yes.  
> Is this project completely **free**? Yes.  
> Is this project **vibe-coded** beyond the author’s ability to comprehend how it works? No, it predates the vibe coding trend.

Given the recent activity with the plugin referenced in the history above, it is a natural point to wrap things up here to avoid any confusion for users.

Thank you all for being part of this journey!

* * *

Plugin History:

- [Sheets Extended](https://github.com/NicoNekoru/obsidan-advanced-table-xt) is a plugin that can merge table cells in reading mode and codeblocks, but there are some bugs.
- At first, I … With no response, I gradually added merging in editing mode …
- 20250318: Completely refactored the reading mode and the codeblock section. Found through [Chinese Forum t35091#24](https://forum-zh.obsidian.md/t/topic/35091/24) that the approach required a fundamental change. In terms of code, this plugin is now fully independent.

Crosspost: [Obsidian Chinese Forum t35091](https://forum-zh.obsidian.md/t/topic/35091/1)

> ****
>
> GitHub: [obsidian-sheets-basic](https://github.com/PlayerMiller109/obsidian-sheets-basic)
> 
> ![20240630_114251](https://forum.obsidian.md/uploads/default/original/3X/2/5/25be0e2abc5733e59dc6c8987f4fdf83e1388d37.gif)

---

<div class="post-metadata">

**Author:** ![k4a](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/k/8e8cbc/32.png) [@k4a](https://forum.obsidian.md/u/k4a)\
**Post date:** [September 10, 2024, 5:52am UTC](https://forum.obsidian.md/t/mini-plugin-sheets-basic-merge-markdown-table-cells/84520/2 "2024-09-10T05:52:08Z")

</div>

Excellent. Exactly what I was looking for.  
Just a few bugs and things I would like to improve.  
The code on github is javascript (after build?). but do you have the typescript source, or are you editing it in javascript?

---

<div class="post-metadata">

**Author:** ![PlayerMiller](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/p/aca169/32.png) [@PlayerMiller](https://forum.obsidian.md/u/PlayerMiller)\
**Post date:** [September 10, 2024, 6:19am UTC](https://forum.obsidian.md/t/mini-plugin-sheets-basic-merge-markdown-table-cells/84520/3 "2024-09-10T06:19:03Z")

</div>

@k4a It’s in JS. See here.

> [@PlayerMiller](#):
>
> It is written in pure JS

> Just a few bugs

By the way, what bug is it? Maybe I can help fix it together?

---

<div class="post-metadata">

**Author:** ![k4a](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/k/8e8cbc/32.png) [@k4a](https://forum.obsidian.md/u/k4a)\
**Post date:** [September 16, 2024, 4:22am UTC](https://forum.obsidian.md/t/mini-plugin-sheets-basic-merge-markdown-table-cells/84520/4 "2024-09-16T04:22:22Z")

</div>

@PlayerMiller  
My apologies.  
I was only looking at the behavior and missed the `Deficiencies`.

Also, the term ‘bug’ is somewhat inadequate; there are behaviors that we would like to improve.  
 ![8d37468b47640d6297ef8d464e3d4f53](https://forum.obsidian.md/uploads/default/original/3X/c/c/cc409b30c6f248ea963aedc3475bd443dcdec763.gif)

I can get around this by using the `rebuildCurrent` you provided, but if I press down on the tab without unbinding the cell join, the join symbol cell is pushed out and created.  
I thought it would be more convenient to unjoin cells when a table is selected, even if that is not the case.

I was hoping to improve that minor experience, but it is somewhat difficult for me to edit the JS that is visible after the build, which is how I ended up asking for TS.

As for whether or not it can be submitted to the plugin market, there should be no particular notation restrictions.  
There is no need to have a TS, as long as the final deliverables, main.js and manifest.json, are available.

---

<div class="post-metadata">

**Author:** ![PlayerMiller](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/p/aca169/32.png) [@PlayerMiller](https://forum.obsidian.md/u/PlayerMiller)\
**Post date:** [September 16, 2024, 10:03am UTC](https://forum.obsidian.md/t/mini-plugin-sheets-basic-merge-markdown-table-cells/84520/5 "2024-09-16T10:03:25Z")

</div>

@k4a

The phenomenon brought up by Tab should be the same as placing the cursor in a signifier cell when `rebuildCurrent`. It is caused by the `receiveCellFocus()` function within the `tableCell.table` object written by Obsidian. Therefore, to solve this problem, we must determine which cell should gain focus when using Tab or something else to move the cursor.

By the way, the method you used in your GIF is a bit complex. You can click in the cell and press `F5` for your case.

> unjoin cells when a table is selected

When we do a merge, we expect to have a stable bigger cell. This allows for a more pleasing appearance when entering multiple lines of content. Therefore, unmerging upon selecting the cell is not very feasible.

> after the build

No. It’s the same on my computer. The built one looks like this:

![image](https://forum.obsidian.md/uploads/default/original/3X/a/f/afdfdf5930fa8e1a1b36262108c6c483b97b5ddd.png)

---

<div class="post-metadata">

**Author:** ![k4a](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/k/8e8cbc/32.png) [@k4a](https://forum.obsidian.md/u/k4a)\
**Post date:** [September 16, 2024, 11:31am UTC](https://forum.obsidian.md/t/mini-plugin-sheets-basic-merge-markdown-table-cells/84520/6 "2024-09-16T11:31:37Z")

</div>

Thank you for your answer.

I guess I was wrong about the “after build” part.  
I have rarely touched pure JS recently, so I misunderstood.

* * *

> If you use `'active-leaf-change'` and `this.registerDomEvent(document, 'keydown', evt=> {})` , the `tableCell` has become `null` when pressing Tab.

I tried my best to fix it in TS using my spare time, but gave up because it was difficult to tie the type information of the part that seems to touch codemirror directly.  
Indeed, as far as my problem is concerned, `F5` will solve it, so I don’t think I need to worry about it that much.

* * *

> When we do a merge, we expect to have a stable bigger cell.

I’m used to being in a raw state when I type, since the classic markdown editors (as was the old obsidian editor) are completely separate from editing and viewing.  
So I thought it would be easier to edit if it was unmerged when typing.  
However, your opinion has made me reconsider.

* * *

In any case, I found that overall I was mistaken.  
I apologize for the trouble.

Again, I am deeply grateful to you for sharing the plugin that fit my needs perfectly.

---

<div class="post-metadata">

**Author:** ![k4a](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/k/8e8cbc/32.png) [@k4a](https://forum.obsidian.md/u/k4a)\
**Post date:** [September 17, 2024, 3:16am UTC](https://forum.obsidian.md/t/mini-plugin-sheets-basic-merge-markdown-table-cells/84520/8 "2024-09-17T03:16:56Z")

</div>

@PlayerMiller  
Thank you so much!

```js
// If focus is on a merge cell, move to the merge destination
const old = table.receiveCellFocus;
table.receiveCellFocus = function (row, col, func, flag) {
	while (table.rows[row][col].text == Sign.left)
		col += col >= table.currentPos.col ? 1 : -1;
	while (table.rows[row][col].text == Sign.up)
		row += row >= table.currentPos.row ? 1 : -1;
	table.currentPos = { row, col };
	old.call(this, row, col, func, flag);

```

I made some modifications to the code reference.  
It seems to be able to move up, down, left, and right if it looks like this.

However, I think it will be difficult to deal with future changes in behavior when obsidian is updated with JS…  
Especially since I added a selfish property like `currentPos ` this time.

P.S.  
Still buggy…  
I found that I can’t edit because I can’t cursor over cells such as `<`.

In any case, I’m happy with the current operation, so you don’t have to worry too much about this problem.

---

<div class="post-metadata">

**Author:** ![k4a](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/k/8e8cbc/32.png) [@k4a](https://forum.obsidian.md/u/k4a)\
**Post date:** [September 17, 2024, 3:30am UTC](https://forum.obsidian.md/t/mini-plugin-sheets-basic-merge-markdown-table-cells/84520/9 "2024-09-17T03:30:31Z")

</div>

```diff
const old = table.receiveCellFocus;
table.receiveCellFocus = function (row, col, func, flag) {
+	if (table.rows[row][col].el.style.display == "none") {
		while (table.rows[row][col].text == Sign.left)
			col += col >= table.currentPos.col ? 1 : -1;
		while (table.rows[row][col].text == Sign.up)
			row += row >= table.currentPos.row ? 1 : -1;
+	}
	table.currentPos = { row, col };
	old.call(this, row, col, func, flag);
};

```

---

<div class="post-metadata">

**Author:** ![PlayerMiller](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/p/aca169/32.png) [@PlayerMiller](https://forum.obsidian.md/u/PlayerMiller)\
**Post date:** [September 17, 2024, 6:25am UTC](https://forum.obsidian.md/t/mini-plugin-sheets-basic-merge-markdown-table-cells/84520/10 "2024-09-17T06:25:15Z")

</div>

Nice trick, thanks.

![20240917_142326](https://forum.obsidian.md/uploads/default/original/3X/2/c/2cc464691c70f411b609f72b2324d8543170ba97.gif)

---

<div class="post-metadata">

**Author:** ![PlayerMiller](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/p/aca169/32.png) [@PlayerMiller](https://forum.obsidian.md/u/PlayerMiller)\
**Post date:** [June 17, 2026, 1:42pm UTC](https://forum.obsidian.md/t/mini-plugin-sheets-basic-merge-markdown-table-cells/84520/11 "2026-06-17T13:42:13Z")

</div>

Given the recent activity with the plugin referenced in the history above, it is a natural point to wrap things up here to avoid any confusion for users.

Thank you all for being part of this journey!
