File tree 1 file changed +12
-4
lines changed
packages/react/src/components/DataTable
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ const TableHeader = React.forwardRef(function TableHeader(
51
51
{
52
52
className : headerClassName ,
53
53
children,
54
+ colSpan,
54
55
isSortable,
55
56
isSortHeader,
56
57
onClick,
@@ -63,7 +64,7 @@ const TableHeader = React.forwardRef(function TableHeader(
63
64
) {
64
65
if ( ! isSortable ) {
65
66
return (
66
- < th { ...rest } className = { headerClassName } scope = { scope } >
67
+ < th { ...rest } className = { headerClassName } scope = { scope } colSpan = { colSpan } >
67
68
< span className = { `${ prefix } --table-header-label` } > { children } </ span >
68
69
</ th >
69
70
) ;
@@ -80,10 +81,11 @@ const TableHeader = React.forwardRef(function TableHeader(
80
81
81
82
return (
82
83
< th
83
- scope = { scope }
84
- className = { headerClassName }
85
84
aria-sort = { ariaSort }
86
- ref = { ref } >
85
+ className = { headerClassName }
86
+ colSpan = { colSpan }
87
+ ref = { ref }
88
+ scope = { scope } >
87
89
< button className = { className } onClick = { onClick } { ...rest } >
88
90
< span className = { `${ prefix } --table-header-label` } > { children } </ span >
89
91
< Arrow
@@ -120,6 +122,12 @@ TableHeader.propTypes = {
120
122
*/
121
123
children : PropTypes . node ,
122
124
125
+ /**
126
+ * Specify `colSpan` as a non-negative integer value to indicate how
127
+ * many columns the TableHeader cell extends in a table
128
+ */
129
+ colSpan : PropTypes . number ,
130
+
123
131
/**
124
132
* Specify whether this header is one through which a user can sort the table
125
133
*/
You can’t perform that action at this time.
0 commit comments