dojo / dojo/widgets

[Grid] CSS Styling of grid cells

Open
#663 0 comments 0 reactions 0 assignees View on GitHub
low priority
Dominant language
TypeScript
Stars
92
Forks
63
PR merge metrics
No merged PRs in 30d

Description

**Enhancement**

Currently it is not possible to style the container of a grid cell.
I have a custom cell renderer for a certain column, which works fine, but I'd like to center the value in the cell, because I basically show a fontawesome image, which I'd like to have centered rather than aligned left.

Package Version:Dojo 5

**Code**

This is part of my ColumnConfig:

```
renderer: (props: { value: string }) => {
return v(
'span',
{
classes: [props.value == 'male' ? 'fas fa-male' : 'fas fa-female', css.gender]
},
[]
);
}
```

The rendered span itself cannot tell this parent to align it centered and I do not have any chance to tell the cell div container to center its contents.

**Expected behavior:**

A _classes_ or _extraclasses_ property in the column config for the gender column would help a lot.

**Actual behavior:**

There is no opportunity to apply a certain CSS style for the cell container div.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.