table icon indicating copy to clipboard operation
table copied to clipboard

After putting width why is it becoming so long yet?

Open Angryman18 opened this issue 3 years ago • 1 comments

Describe the bug

i have put the width in that email column but its still going so long. data is dummy. Screenshot from 2022-09-02 17-04-33

Your minimal, reproducible example

nope

Steps to reproduce

simple self explainatory

Expected behavior

it shouldn't exceed it's width

How often does this bug happen?

No response

Screenshots or Videos

Screenshot from 2022-09-02 17-04-33

Platform

Linux

react-table version

7.7

TypeScript version

only JS

Additional context

No response

Terms & Code of Conduct

  • [X] I agree to follow this project's Code of Conduct
  • [X] I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Angryman18 avatar Sep 02 '22 11:09 Angryman18

I suppose this is a CSS issue. Since the email is so long, the CSS isn't able to truncate it according to the CSS that you defined.

If you add some of CSS rules below, you will see the change:

td {
    white-space: wrap;
    overflow: hidden; 
    text-overflow: ellipsis;
    max-width: <a static value in pixel / character etc>;
}

td:hover {
    overflow: unset;
    text-overflow: unset;
}

But keep in your mind, safari and chrome show different behavior according to my experience. You should play with the CSS.

talatkuyuk avatar Sep 04 '22 17:09 talatkuyuk

We cannot see your code because you said "nope", but I suspect you simply forgot to add CSS or styles that extracted and implemented the width of a column that you had set in your column definitions. It is a common mistake.

As @talatkuyuk said, add some styles to your <td>, and then your column sizes will be applied

<td style={{ width: column.getSize() }}
 //...
</td>

KevinVandy avatar Oct 22 '22 01:10 KevinVandy