# Editable table copy paste problem

**URL:** <https://community.plotly.com/t/editable-table-copy-paste-problem/71396>\
**Category:** Dash Python\
**Created:** [January 6, 2023, 6:54pm UTC](https://community.plotly.com/t/editable-table-copy-paste-problem/71396 "2023-01-06T18:54:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![secret](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@secret](https://community.plotly.com/u/secret)\
**Post date:** [January 6, 2023, 6:54pm UTC](https://community.plotly.com/t/editable-table-copy-paste-problem/71396/1 "2023-01-06T18:54:41Z")

</div>

Hi everyone,

I need help with one issue. I created a DashTable with editable feature when the user tries to copy paste a data with enters on and it creates new lines into the table and it crashes.

Do you have any suggestions ?

Thanks,

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [January 6, 2023, 9:31pm UTC](https://community.plotly.com/t/editable-table-copy-paste-problem/71396/2 "2023-01-06T21:31:50Z")

</div>

Hello @secret,

It’s a little hard to know what exactly is going on, could you please provide an MRE?

> [@How to write a Minimal Reproducible Example (MRE)](https://community.plotly.com/t/how-to-write-a-minimal-reproducible-example-mre/61502):
>
> Adding a minimal reproducible example to your questions will help attract community members to answer your question. The goal of writing a MRE is to allow other members of the community to run the code on their computers and “reproduce” the error, so that they can best help you. Please make sure that your MRE includes data and that the code is correctly pre-formatted. To preformat, copy and paste the code in your post and then click on \</\> (Preformatted text), as shown on the image:

---

<div class="post-metadata">

**Author:** ![secret](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@secret](https://community.plotly.com/u/secret)\
**Post date:** [January 7, 2023, 2:00am UTC](https://community.plotly.com/t/editable-table-copy-paste-problem/71396/3 "2023-01-07T02:00:18Z")

</div>

Hello, sorry for the lack of information.

So, I have an editable DashTable. I can edit the columns one by one. During the edit, if I paste a really long text like paste a page, the structure of the table is getting broken. The paste creates new lines and the whole table deteriorate as in the pictures.

 ![cp1](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/9/2/924db35b74062e4dcd547995cbb1bf97f562897d.png)  
 ![cp2](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/9/0/90ad284ade5b0f60ce931f0972fd24e4db14f016.png)

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [January 7, 2023, 2:04am UTC](https://community.plotly.com/t/editable-table-copy-paste-problem/71396/4 "2023-01-07T02:04:12Z")

</div>

Ah, you can setup maximum column widths so that this doesnt happen. 🙂

> **[DataTable Width & Column Width | Dash for Python Documentation | Plotly](https://dash.plotly.com/datatable/width)**
>
> \`dash\_table.DataTable\` is an interactive table that supports rich styling, conditional formatting, editing, sorting, filtering, and more.

---

<div class="post-metadata">

**Author:** ![secret](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@secret](https://community.plotly.com/u/secret)\
**Post date:** [January 7, 2023, 2:39am UTC](https://community.plotly.com/t/editable-table-copy-paste-problem/71396/5 "2023-01-07T02:39:27Z")

</div>

Width or height ?

I put maxHeight = 0. Still happening

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [January 7, 2023, 2:44am UTC](https://community.plotly.com/t/editable-table-copy-paste-problem/71396/6 "2023-01-07T02:44:27Z")

</div>

You’ll need to adjust the width.

---

<div class="post-metadata">

**Author:** ![secret](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@secret](https://community.plotly.com/u/secret)\
**Post date:** [January 7, 2023, 2:48am UTC](https://community.plotly.com/t/editable-table-copy-paste-problem/71396/7 "2023-01-07T02:48:50Z")

</div>

it is happening with maxwidth = 0 for multiple lines. When I copy paste a long data to editable table. Pasted data overflows to the other rows and deteriorates the whole table.

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [January 7, 2023, 3:43am UTC](https://community.plotly.com/t/editable-table-copy-paste-problem/71396/8 "2023-01-07T03:43:39Z")

</div>

Check out this part:

> **[DataTable Width & Column Width | Dash for Python Documentation | Plotly](https://dash.plotly.com/datatable/width#overflowing-into-ellipses)**
>
> \`dash\_table.DataTable\` is an interactive table that supports rich styling, conditional formatting, editing, sorting, filtering, and more.

Note, the important part is what you do with the overflow, otherwise it will just force it to expand. 🙂

---

<div class="post-metadata">

**Author:** ![secret](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@secret](https://community.plotly.com/u/secret)\
**Post date:** [January 12, 2023, 7:38pm UTC](https://community.plotly.com/t/editable-table-copy-paste-problem/71396/9 "2023-01-12T19:38:15Z")

</div>

I think I could not explain my problem well. So, the problem is not weight or height, if you copy a paragraph which has bunch of new lines, and if you paste that paragraph to one spot in the table such as [1,1] index, those new line entries put each of them in to other rows and all paragraph pasted into [1,1] , [1,2], [1,3].

So, I need a preprocessing for input to change those lines into space so that it can be converted into a sentence so that it would not affect other rows.

---

<div class="post-metadata">

**Author:** ![jinnyzor](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jinnyzor/32/21194_2.png) [@jinnyzor](https://community.plotly.com/u/jinnyzor)\
**Post date:** [January 12, 2023, 9:24pm UTC](https://community.plotly.com/t/editable-table-copy-paste-problem/71396/10 "2023-01-12T21:24:27Z")

</div>

I dont know if there is a way to currently keep this from happening.
