{"action":"created","issue":{"url":"https://api.github.com/repos/audreyt/ethercalc/issues/341","repository_url":"https://api.github.com/repos/audreyt/ethercalc","labels_url":"https://api.github.com/repos/audreyt/ethercalc/issues/341/labels{/name}","comments_url":"https://api.github.com/repos/audreyt/ethercalc/issues/341/comments","events_url":"https://api.github.com/repos/audreyt/ethercalc/issues/341/events","html_url":"https://github.com/audreyt/ethercalc/issues/341","id":151179792,"number":341,"title":"Unexpected behavior when adding rows within span of merged cell","user":{"login":"amir-zeldes","id":2188635,"avatar_url":"https://avatars.githubusercontent.com/u/2188635?v=3","gravatar_id":"","url":"https://api.github.com/users/amir-zeldes","html_url":"https://github.com/amir-zeldes","followers_url":"https://api.github.com/users/amir-zeldes/followers","following_url":"https://api.github.com/users/amir-zeldes/following{/other_user}","gists_url":"https://api.github.com/users/amir-zeldes/gists{/gist_id}","starred_url":"https://api.github.com/users/amir-zeldes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amir-zeldes/subscriptions","organizations_url":"https://api.github.com/users/amir-zeldes/orgs","repos_url":"https://api.github.com/users/amir-zeldes/repos","events_url":"https://api.github.com/users/amir-zeldes/events{/privacy}","received_events_url":"https://api.github.com/users/amir-zeldes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-26T16:27:17Z","updated_at":"2016-05-05T07:56:44Z","closed_at":null,"body":"When adding a row at a position that is inside the span of a merged cell covering several rows, the merged cell does not update to end one row further below: instead the merged cell continues to end at the same row number as before. This creates a 'shortfall', or also a gap between consecutive merged cell. \r\n\r\nTo illustrate, consider the following example: a user wishes to add a transaction to a list of transactions, which is continuously spanned by quarter and year columns to the right:\r\n\r\n![ethercalc_before_insert](https://cloud.githubusercontent.com/assets/2188635/14825982/f60e0d56-0ba9-11e6-8bb8-958c51e2b02f.png)\r\n\r\nIf the user now inserts a new transaction record row below row 4 (between transactions C and D), the expected behavior, as in popular desktop spreadsheet editors, is for the quarter and year spans to adjust to end one row further below. However, the actual behavior creates gaps in columns 2 and 3, as shown here:\r\n\r\n![ethercalc_after_insert](https://cloud.githubusercontent.com/assets/2188635/14826019/206e3c7e-0baa-11e6-9b88-c1da4fb0d2e9.png)\r\n\r\nIf there are many columns, with different length spans, this can be very difficult and cumbersome to correct."},"comment":{"url":"https://api.github.com/repos/audreyt/ethercalc/issues/comments/217096661","html_url":"https://github.com/audreyt/ethercalc/issues/341#issuecomment-217096661","issue_url":"https://api.github.com/repos/audreyt/ethercalc/issues/341","id":217096661,"user":{"login":"eddyparkinson","id":7961707,"avatar_url":"https://avatars.githubusercontent.com/u/7961707?v=3","gravatar_id":"","url":"https://api.github.com/users/eddyparkinson","html_url":"https://github.com/eddyparkinson","followers_url":"https://api.github.com/users/eddyparkinson/followers","following_url":"https://api.github.com/users/eddyparkinson/following{/other_user}","gists_url":"https://api.github.com/users/eddyparkinson/gists{/gist_id}","starred_url":"https://api.github.com/users/eddyparkinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddyparkinson/subscriptions","organizations_url":"https://api.github.com/users/eddyparkinson/orgs","repos_url":"https://api.github.com/users/eddyparkinson/repos","events_url":"https://api.github.com/users/eddyparkinson/events{/privacy}","received_events_url":"https://api.github.com/users/eddyparkinson/received_events","type":"User","site_admin":false},"created_at":"2016-05-05T07:56:44Z","updated_at":"2016-05-05T07:56:44Z","body":">Worst case is O(n)\r\n\r\nAgree - also looks like your worst case suggestion looks like the one to use.\r\n\r\nCommand:\r\n**merge J2:J4\r\n**\r\nSets the rowspan and colspan of the cell J2 - nothing else looks to be changed.\r\n\r\n"}}