Open bvaughn opened 9 years ago
These nested nodes are currently necessary for the method of vertical alignment for each cell. We're currently working on a release that does flatten this though.
I see. I'm surprised to hear that's the reason. But I'm glad to hear it will be addressed with an update. Thank you for the information. :)
+1
Vertical alignment is meh, the users can handle that themselves since we're all in control over row height anyway.
To dig this up from last year, I definitely would not use this unless you moved to table
elements over div
s. table
is semantic, whereas div
isn't. Are there any plans to do this?
@jamesseanwright Check out react-virtualized FlexTable
as a possible alternative if you're looking for similar functionality with a cleaner DOM.
(It also uses <div>
but with aria roles.)
Hi guys. Thanks for creating and maintaining this library. :)
I'm working on a project that uses it. I recent took a look at the markup generated this component and it does not seem very optimized. Each "cell" in the "table" (what would be a
<td>
in a regular HTML<table>
) actually consists of many nested nodes:I understand that plain HTML
<table>
doesn't work well for the fixed header interface this library is offering. But why is this nested structure required for each cell? So far as I know, nesting a table inside of an inline-block element doesn't do anything more than just using the inline-block element directly.Why could the above markup not be simplified to:
For that matter, is the inner cell-content wrapper even necessary? Why not just:
At the point where you're managing widths and row-heights to make things appear like a classical HTML table, I don't see what the
display: table
rules buy you. Any chance you could collapse some of these nodes and lighten the DOM load on the browser?