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.

Tbody in Column component

See original GitHub issue

Hi Guys!

I just want to ask about Column component. It has a tag. Because of that, when I put Column in Section component error validateDOMNesting(...): <p> cannot appear as a child of <tbody>. appears. Components structure look like this:

<Html>
      <Head />
      <Section>
          <Column style={{ width: '30%' }}>
              <Text>Column 1</Text>
            </Column>
            <Column style={{ width: '70%' }}>
              <Text>Column 2</Text>
            </Column>
      </Section>
    </Html>

And after render to string, html is invalid because all columns move to of <Html>.

What is structure should be? What did I do wrong with these components?

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
cassiorsfreitascommented, Dec 8, 2022

Guys, i’ve been doing some changes regarding these two components (Column and Section). These components are pretty much linked, right? I mean, there’s no way to think in rows (vertical divisions) without thinking in columns (horizontal divisions) when we’re talking about tables. So, fully independently implementing these components doesn’t sound good to me. The Column component is responsible for creating td columns inside the Section component that creates tr rows.

<Section>
    <Column></Column>
    <Column></Column>
    <Column></Column>
</Section>

I’ve also added a style that organizes, centers and assigns the same width to all columns inserted in the section. In other words, users don’t need to worry about it, but can change it if they want.

HTML static example: https://codesandbox.io/s/section-and-column-example-lic7bh?file=/index.html

1reaction
bukinoshitacommented, Dec 8, 2022

@zenorocha Thanks for quick response and for this good lib! Can you suggest some proper way to make columns instead of using Column component?

You can try using with a div or table for now until we release a new version with the fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

<tbody>: The Table Body element - HTML - MDN Web Docs
This attribute is used to indicate the number of characters to offset the column data from the alignment characters specified by the char ......
Read more >
<tbody> HTML Tag »
The tbody contains the body, or primary content, of an HTML table . Use it along with the thead and tfoot elements to...
Read more >
<tbody> element is stuffed into first column of a table
You have to use "table-row-group", not "block" as the value of the "display" property when showing the table row group (the <tbody> )....
Read more >
What is the <tbody> element in HTML? - Educative.io
The <tbody> tag stands for table body. In HTML, there are three parts of a table ( <table> tag): header, body, and footer....
Read more >
HTML tbody tag - W3Schools
The <tbody> tag is used to group the body content in an HTML table. The <tbody> element is used in conjunction with the...
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