Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@workday/canvas-kit-css-table
Advanced tools
Readme
Data table styling for Canvas Kit.
yarn add @workday/canvas-kit-css
or
yarn add @workday/canvas-kit-css-table
Add your node_modules
directory to your SASS includePaths
. You will then be able to import
index.scss
.
@import '~@workday/canvas-kit-css-table/index.scss';
Use .wdc-table
on a <table>
element.
Use table group elements (<thead>
, <tbody>
) as some styles are specific to the groups.
<table class="wdc-table">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Name</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Aidan Brown</td>
</tr>
<tr>
<td>2</td>
<td>Betty Chen</td>
</tr>
<tr>
<td>3</td>
<td>Helen Gonzalez</td>
</tr>
<tr>
<td>4</td>
<td>Timothy May</td>
</tr>
</tbody>
</table>
If you would like to add meta information above a table (name, count and/or actions), you can place
the .wdc-table-meta
container before the .wdc-table
.
<div class="wdc-table-meta">
<div class="wdc-table-info">
<span class="wdc-table-name">Data Grid Name</span>
<span class="wdc-table-row-count">4 Items</span>
</div>
<div class="wdc-icon-list">
<div class="wdc-icon-list-icon">
<!-- wd-icon-filter.svg -->
</div>
<div class="wdc-icon-list-icon">
<!-- wd-icon-chart-config.svg -->
</div>
</div>
</div>
<table class="wdc-table">
...
</table>
Center align a cell's contents with .wdc-table-cell-center
.
Right align a cell's contents with .wdc-table-cell-right
.
<table class="wdc-table">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Name</th>
</tr>
</thead>
<tbody>
<tr>
<td class="wdc-table-cell-center">1</td>
<td class="wdc-table-cell-right">Aidan Brown</td>
</tr>
</tbody>
</table>
Tables are compatible with checkbox selects.
Use .wdc-table-cell-center
on the <td>
element containing the checkbox to center the checkbox.
<table class="wdc-table">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Name</th>
</tr>
</thead>
<tbody>
<tr>
<td class="wdc-table-cell-center"><input type="checkbox" class="wdc-form-checkbox" /></td>
<td>Aidan Brown</td>
</tr>
</tbody>
</table>
Explicitly apply hover styling to a table row by using .wdc-table-row-hover
.
<table class="wdc-table">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Name</th>
<th scope="col">Position</th>
<th scope="col">Location</th>
</tr>
</thead>
<tbody>
<tr class="wdc-table-row-hover">
<td>1</td>
<td>Aidan Brown</td>
<td>Product Manager</td>
<td>San Francisco, CA</td>
</tr>
</tbody>
</table>
Apply selected styling to a table row by using .wdc-table-row-selected
.
<table class="wdc-table">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Name</th>
<th scope="col">Position</th>
<th scope="col">Location</th>
</tr>
</thead>
<tbody>
<tr class="wdc-table-row-selected">
<td>1</td>
<td>Aidan Brown</td>
<td>Product Manager</td>
<td>San Francisco, CA</td>
</tr>
</tbody>
</table>
Apply selected styling to a table row by using .wdc-table-row-error
.
<table class="wdc-table">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col" id="name-heading">Name</th>
</tr>
</thead>
<tbody>
<tr class="wdc-table-row-error">
<td>1</td>
<td>
<input
type="text"
class="wdc-form-textinput"
value="Alex Black"
aria-labelledby="name-heading"
/>
</td>
</tr>
</tbody>
</table>
Apply selected styling to a table row by using .wdc-table-row-alert
.
<table class="wdc-table">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col" id="name-heading">Name</th>
</tr>
</thead>
<tbody>
<tr class="wdc-table-row-alert">
<td>1</td>
<td>
<input
type="text"
class="wdc-form-textinput"
value="Alex Black"
aria-labelledby="name-heading"
/>
</td>
</tr>
</tbody>
</table>
Signal errors and alerts for input fields by using
.wdc-table-row-error-borderless
/.wdc-table-row-alert-borderless
on the row and
.wdc-form-error
/.wdc-form-alert
on the input field.
Refer to
canvas-kit-css-forms
for more information regarding input field errors.
<table class="wdc-table">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col" id="name-heading">Name</th>
</tr>
</thead>
<tbody>
<tr class="wdc-table-row-alert-borderless">
<td>1</td>
<td>
<input
type="text"
class="wdc-form-textinput wdc-form-alert"
value="Alex Black"
aria-labelledby="name-heading"
/>
</td>
</tr>
<tr class="wdc-table-row-error-borderless">
<td>1</td>
<td>
<input
type="text"
class="wdc-form-textinput wdc-form-error"
value="Aidan Brown"
aria-labelledby="name-heading"
/>
</td>
</tr>
</tbody>
</table>
FAQs
Table CSS for Canvas kit
The npm package @workday/canvas-kit-css-table receives a total of 279 weekly downloads. As such, @workday/canvas-kit-css-table popularity was classified as not popular.
We found that @workday/canvas-kit-css-table demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.