-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added stickyRightcolumn prop and example doc. Adjusted styling to acc…
…omodate prop
- Loading branch information
Showing
8 changed files
with
206 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
playbook/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import React from 'react' | ||
import Table from '../_table' | ||
|
||
const TableStickyLeftColumns = () => { | ||
return ( | ||
<Table | ||
responsive="scroll" | ||
size="md" | ||
stickyRightcolumn={["13", "14", "15"]} | ||
> | ||
<thead> | ||
<tr> | ||
<th>{'Column 1'}</th> | ||
<th>{'Column 2'}</th> | ||
<th>{'Column 3'}</th> | ||
<th>{'Column 4'}</th> | ||
<th>{'Column 5'}</th> | ||
<th>{'Column 6'}</th> | ||
<th>{'Column 7'}</th> | ||
<th>{'Column 8'}</th> | ||
<th>{'Column 9'}</th> | ||
<th>{'Column 10'}</th> | ||
<th>{'Column 11'}</th> | ||
<th>{'Column 12'}</th> | ||
<th id="13">{'Column 13'}</th> | ||
<th id="14">{'Column 14'}</th> | ||
<th id="15">{'Column 15'}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>{'Value 1'}</td> | ||
<td>{'Value 2'}</td> | ||
<td>{'Value 3'}</td> | ||
<td>{'Value 4'}</td> | ||
<td>{'Value 5'}</td> | ||
<td>{'Value 6'}</td> | ||
<td>{'Value 7'}</td> | ||
<td>{'Value 8'}</td> | ||
<td>{'Value 9'}</td> | ||
<td>{'Value 10'}</td> | ||
<td>{'Value 11'}</td> | ||
<td>{'Value 12'}</td> | ||
<td id="13">{'Value 13'}</td> | ||
<td id="14">{'Value 14'}</td> | ||
<td id="15">{'Value 15'}</td> | ||
</tr> | ||
<tr> | ||
<td>{'Value 1'}</td> | ||
<td>{'Value 2'}</td> | ||
<td>{'Value 3'}</td> | ||
<td>{'Value 4'}</td> | ||
<td>{'Value 5'}</td> | ||
<td>{'Value 6'}</td> | ||
<td>{'Value 7'}</td> | ||
<td>{'Value 8'}</td> | ||
<td>{'Value 9'}</td> | ||
<td>{'Value 10'}</td> | ||
<td>{'Value 11'}</td> | ||
<td>{'Value 12'}</td> | ||
<td id="13">{'Value 13'}</td> | ||
<td id="14">{'Value 14'}</td> | ||
<td id="15">{'Value 15'}</td> | ||
</tr> | ||
<tr> | ||
<td>{'Value 1'}</td> | ||
<td>{'Value 2'}</td> | ||
<td>{'Value 3'}</td> | ||
<td>{'Value 4'}</td> | ||
<td>{'Value 5'}</td> | ||
<td>{'Value 6'}</td> | ||
<td>{'Value 7'}</td> | ||
<td>{'Value 8'}</td> | ||
<td>{'Value 9'}</td> | ||
<td>{'Value 10'}</td> | ||
<td>{'Value 11'}</td> | ||
<td>{'Value 12'}</td> | ||
<td id="13">{'Value 13'}</td> | ||
<td id="14">{'Value 14'}</td> | ||
<td id="15">{'Value 15'}</td> | ||
</tr> | ||
</tbody> | ||
</Table> | ||
) | ||
} | ||
|
||
export default TableStickyLeftColumns |
2 changes: 2 additions & 0 deletions
2
playbook/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_react.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
The `stickyRightColumn` prop works in the same way as the above `stickyLeftColumn` prop. It expects an array of the column ids you want to be sticky. Make sure to add the corresponding id to the `<th>` and `<td>`. | ||
If you are using the sub-component variant, then you will pass the id to `<Table.Header>` and `<Table.Cell>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters