Using Jupyter Lab, and coding in r, the way to enter code blocks in a markdown cell is easy and has good and predictable results. Just follow the same steps each time.
Press Esc key, type m for markdown cell, press Enter key. The cursor is now in the markdown cell waiting for instructions.
Press the Tab key once. Most often the tab key is defaulted to four spaces.
Press the Tickmark key 3 times
Press the Enter button once. The cursor will descend 1 line and remain within the tab
Type your code or paste a code block. If code is pasted, it will most likely need to become aligned below the tickmarks. Completely select all the code, then press the Tab key to move the selected code. This will align the code below the tickmarks.
Press the Enter button once. This should place the cursor directly below the start of the code.
Type the Tickmark key 3 times.
Press the Control + Enter keys to exit the markdown cell.