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] Body, Header and Footer rendered in separate tables

See original GitHub issue

Problem description

Table header, body and footer rendered in separate tables.

From the source:

<div style={prepareStyles(Object.assign(styles.tableWrapper, wrapperStyle))}>
  {headerTable}
  <div style={prepareStyles(Object.assign(styles.bodyTable, bodyStyle))} ref="tableDiv">
    <table className={className} style={mergedTableStyle} ref="tableBody">
      {inlineHeader}
      {inlineFooter}
      {tBody}
    </table>
  </div>
  {footerTable}
</div>

Versions

  • Material-UI: 0.15.0

Description

When setting style for a column of table header and the same exact style is not specified in the corresponding table body column, the appearance breaks.

Rendering the header, body and footer separately loses the ability of letting the browser keep the columns across these sections well aligned.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:9
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

10reactions
fzaninottocommented, Oct 11, 2016

I also don’t understand why not using the browser table renderer is considered a feature. Auto-expandable cells based on content is a must IMO. The <Table> component is useless with real content otherwise. I secretly hoped that 0.16 would fix this, but it appears that it doesn’t.

For instance, in admin-on-rest, look at how the ‘id’ column takes too much space and the "post’ column is too narrow:

image

Fixing this requires way too much boilerplate on userland.

Can you explain why this is a feature? If not, can we help fixing the bug?

5reactions
danieljuhlcommented, Feb 14, 2017

@fzaninotto I had the same width issue… <Table style={{ tableLayout: 'auto' }} ...> came to the rescue, incase someone else has the same problem. But fixedHeader={false} is required on <Table>, otherwise the columns want be aligned. So <Table style={{ tableLayout: 'auto' }} fixedHeader={false}>

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Table] Body, Header and Footer rendered in separate tables
Problem description Table header, body and footer rendered in separate tables. From the source: {headerTable}
Read more >
Tables: Columns, Headers, and Footers
Headers and Footers ... thead , tfoot and tbody allow you to separate the table into header, footer and body, which can be...
Read more >
<tbody>: The Table Body element - HTML - MDN Web Docs
This lets you divide the rows in large tables into sections, each of which may be separately formatted if so desired. If not...
Read more >
Table rendered as two separate table may confuse screen ...
DataTables has to split the header, body and footer into separate tables in order to be able to have the header not move...
Read more >
Tables in HTML documents
Table rows may be grouped into a head, foot, and body sections, (via the THEAD , TFOOT and ... User agents must know...
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