Change HTML element of table.
See original GitHub issueCan i change the HTML element of table, today is a <div>
, i would to use <table>
element, it is possible?
Same for other elements of react-table.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
<table>: The Table element - HTML - MDN Web Docs - Mozilla
The <table> HTML element represents tabular data — that is, information presented in a two-dimensional table comprised of rows and columns ...
Read more >HTML Tables: When to Use Them and How to Make & Edit Them
To make a table in HTML, use the <table> tag. Within this table tag, you'll place the <tr>, <th>, and <td> tags. The...
Read more >CRUD in HTML, JavaScript, and jQuery - CODE Magazine
In this first article of a series on working within HTML and the Web API, I'll show you how to add, edit, and...
Read more >Change table td using javascript - html - Stack Overflow
This works: Code snippet. Try this: function trans() { var table = document.getElementById("table"); var row = table.
Read more >HTML Tables - W3Schools
Note: A table cell can contain all sorts of HTML elements: text, images, ... text in <th> elements are bold and centered, but...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This requires a complete re-write of ReactTable due to Tanner’s original comment and the internal reliance on
flexbox
. It would also violate the original principal to make ReactTable page-based and mobile friendly. If a “real” HTML table is required, then ReactTable is probably not the right package or you might require some background “magic” to copy the data into a hidden table first and then copy to the clipboard from that (if it is possible).I was also looking for a way to replace the
<div>
s with “true” HTML table tags. My main intention was to allow the column structure to be kept intact when copying & pasting the grid content to Microsoft Excel (AFAIK without a true HTML table structure, Excel just puts all content into one single column instead of copying the two-dimensional structure successfully). Making the grids more accessible for screen readers and the such may be a relevant case for “true” HTML tags as well.Too bad that the HTML specifications do not seem to offer nested
<tbody>
tags or some kind of “dummy” tag that could be used instead of thert-tr-group
<div>
s. Judging from my short research, the other tags would match quite nicely:rt-table
=<table>
rt-thead
=<thead>
rt-tr
=<tr>
rt-resizable-header
=<th class="resizable">
rt-td
=<td>
rt-tfoot
=<tfoot>
rt-tr-group
= ??? (Here’s the core issue.)Obviously, this would also require additional CSS to override the browser default styles for table elements with the styles that
react-table
requires in order to work.Is there anything I missed that could violate HTML specifications except of the
rt-tr-group
mismatch?