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.

Table header is not responsive

See original GitHub issue

Describe the bug Table looks broken when you have long labels in table header.

To Reproduce Try to render following table:

<Table>
  <Thead>
    <Tr>
      <Th>Very loooooooooooooooooooooooooooooong label</Th>
      <Th>Very loooooooooooooooooooooooooooooong label</Th>
    </Tr>
  </Thead>
  <Tbody>
    {
      [0,1,2,3,4].map(() => {
        return(
          <Tr>
            <Td>testing values testing values testing values testing values </Td>
            <Td>testing values testing values testing values testing values </Td>
          </Tr>
        )
      })
    }
  </Tbody>
</Table>

Expected behavior I am expecting to get the same behaviour as <td> tag for <th>, so when there is no enough space, the line should break into multiple lines.

Screenshots table

Desktop (please complete the following information):

  • OS: Mac OS
  • Browser: Chrome
  • Version: 74.0.3729.169

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
el-lsancommented, Jun 16, 2019

@coston thanks a lot for the fix. it is much better now, however in some cases it still looks broken

image

0reactions
DCosticommented, Sep 19, 2019

@coston My header contains 20 characters. I tried to tweak the css but i didn’t managed to solve it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Data Table headers not responsive to the modal
Im trying to have a datatable in a modal but when i launch the modal, the headers is not responsive. But if the...
Read more >
WordPress table header is not responsive (mobile)
Hi,. We have alot of trouble with tables in our wordpress posts. The tables look great on desktop, but on mobile the header...
Read more >
Table Header not resizing — DataTables forums
The first thing to do is use style="width:100%" on all your table tags. This allows Datatables to properly calculate the column widths. However ......
Read more >
Header Is not responsive on Table Device - XTemos Studio
My header is not responsive on a tablet device but it is responsive on a mobile ... So that it can look the...
Read more >
How to Responsive sticky Header, Footer In Html Table?
The <thead>, <tbody>, and <tfoot>elements do not affect the table layout, and if you want to apply the changes in table layout, then...
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