Skip to content

Commit 101a0fa

Browse files
committed
fix(ui): table should have a header and body group
1 parent ba04766 commit 101a0fa

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

lib/public/components/Table/content.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const row = (value, text) => {
3232
*/
3333
const content = (data, keys, params) => {
3434
const idKey = Object.keys(keys).find((key) => keys[key] && keys[key].primary);
35-
return data.map((entry) =>
36-
h(`tr#row${entry[idKey]}`, params(entry), Object.entries(keys).map(([key, value]) => row(value, entry[key]))));
35+
return h('tbody', data.map((entry) =>
36+
h(`tr#row${entry[idKey]}`, params(entry), Object.entries(keys).map(([key, value]) => row(value, entry[key])))));
3737
};
3838

3939
export default content;

lib/public/components/Table/headers.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ import { h } from '/js/src/index.js';
1717
* @param {Object} keys The full collection of API keys and their corresponding header values
1818
* @return {vnode} An array of rows containing all given header values with specific cell sizes
1919
*/
20-
const headers = (keys) =>
21-
h('tr#headers', Object.values(keys).map((value) => {
22-
const size = value.size || 'cell-m';
23-
return h(`th.${size}`, value.name);
24-
}));
20+
const headers = (keys) => h('thead', h('tr', Object.values(keys).map((value) => {
21+
const size = value.size || 'cell-m';
22+
return h(`th.${size}`, { scope: 'col' }, value.name);
23+
})));
2524

2625
export default headers;

0 commit comments

Comments
 (0)