> For the complete documentation index, see [llms.txt](https://docs.bdb.ai/data-science-lab-6/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bdb.ai/data-science-lab-6/data-science-notebook/.ipynb-file-cells/using-a-markdown-cell/expanding-and-collapsing-markdown-cell.md).

# Expanding and Collapsing Markdown Cell

The user can expand and collapse the multiple Markdown cells based on their levels in a DS Notebook. The user can create a hierarchy of three levels using the ***Heading*** option in a Markdown cell.&#x20;

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark>*&#x20;

* *The related code cells under one Markdown will fall into the same level as the Markdown.*
* *The maximum three levels of hierarchy can be inserted for a Markdown cell using the Heading option.*&#x20;
  {% endhint %}

{% hint style="success" %}
*Check out the following illustration on how to set the expand and collapse functionality in Markdown cells.*
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28ipFzCz8EMtVtHrBFLx%2Fuploads%2FmwXBwnUqkCm8bnEtjxBf%2FAssigning%20Various%20Levels%20to%20the%20Markdown%20cells.mp4?alt=media&token=5e393da0-f8f2-4064-ac25-3ad95c18946f>" %}
Assigning Verious Levels to Markdown Cells
{% endembed %}

* Navigate to a Notebook.
* Access a Markdown cell.

  <figure><img src="/files/gu7y2gbBMXao5zA45Ssi" alt=""><figcaption></figcaption></figure>
* To create a hierarchy within a Markdown cell, use the Heading button.&#x20;
  * Click once for the first level, twice for the second, and thrice for the third.&#x20;
  * Unassigned Markdown cells default to the nearest existing hierarchy.&#x20;
  * Remember to click Save to preserve changes.

    <figure><img src="/files/Pb8QuKHv9biPLg2ax4Qg" alt=""><figcaption></figcaption></figure>
* The Markdown cell will get a collapse/expand icon added to it.

  <figure><img src="/files/iAgyy63hcIVOHtA90UVI" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
*Check out the illustration to see the Markdown expand and collapse feature at work.*
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhFEvs46BuaaHAKNDSR6T%2Fuploads%2F9A4AUSzpyU4aMVjZ8EKW%2FMarkdown%20cells_Expand%20%26%20collapse.mp4?alt=media&token=3b2a4c98-28b4-45ac-9b5e-282b04b3200c>" %}
***Expanding and Collapsing Markdown Cells***
{% endembed %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bdb.ai/data-science-lab-6/data-science-notebook/.ipynb-file-cells/using-a-markdown-cell/expanding-and-collapsing-markdown-cell.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
