question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to add ellipsis (...) to table cells, headers when content doesn't fit

See original GitHub issue

Issuehunt badges

What problem does this feature solve?

Right now when the table is resized and the content doesn’t fit, the text is broken and reflows to the next row, thus appearing rather bad. Adding an option to allow ellipsis sign (…) by adding text-overflow:ellipsis; where required to appear would increase the usability IMHO.

Thanks in advance!

What does the proposed API look like?

ellipsize={true} in column properties


IssueHunt Summary

Backers (Total: $25.00)

Become a backer now!

Or submit a pull request to get the deposits!

Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:18
  • Comments:27 (9 by maintainers)

github_iconTop GitHub Comments

43reactions
gyertscommented, Jan 24, 2019
const columns = [
   {
      title: 'Title',
      dataIndex: 'title',
      key: 'title',
      width: '30%',
      onCell: () => {
         return {
            style: {
               whiteSpace: 'nowrap',
               maxWidth: 150,
            }
         }
      },
      render: (text) => (
         <Tooltip title={text}>
            <div style={{textOverflow: 'ellipsis', overflow: 'hidden'}}>{text}</div>
         </Tooltip>
      )
   }
}
26reactions
sitchcommented, Aug 29, 2018

Solution:

table.fixed {
  table-layout: fixed;
}
td.truncated {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

and make sure you set width in your columns definitions

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS text-overflow in a table cell?
To clip text with an ellipsis when it overflows a table cell, you will need to set the max-width CSS property on each...
Read more >
Option to add ellipsis (...) to table cells, headers ... - Issuehunt
Right now when the table is resized and the content doesn't fit, the text is broken and reflows to the next row, thus...
Read more >
How To Make CSS Ellipsis Work on a Table Cell - W3docs
Another possible way of making an ellipsis work on a table cell is using the CSS table-layout property with its "fixed" value on...
Read more >
Resize columns and truncate cell content with ellipsis in table ...
I have tables with various widths and want to truncate the columns and its content with text-overflow:ellipsis to fit the screen (down to...
Read more >
How To Fix Text-Overflow Ellipsis Not Working - Semicolon.dev
To make ellipsis work in a table, one way to do it, is by setting min-width to 0 on the cell. It's a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found