# Cell background color instead of text only

**URL:** <https://discuss.elastic.co/t/cell-background-color-instead-of-text-only/152492>\
**Category:** Kibana\
**Created:** [October 15, 2018, 12:35pm UTC](https://discuss.elastic.co/t/cell-background-color-instead-of-text-only/152492 "2018-10-15T12:35:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fxprunayre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fxprunayre/32/22478_2.png) [@fxprunayre](https://discuss.elastic.co/u/fxprunayre)\
**Post date:** [October 15, 2018, 12:35pm UTC](https://discuss.elastic.co/t/cell-background-color-instead-of-text-only/152492/1 "2018-10-15T12:35:43Z")

</div>

Hi, any work existing to apply to the table cell the color field format defined ?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/2/b2841561b2a6a42a9511b6d62ab715b9c1eebefa.png)

The main issue is that:

- the table cell contains a `truncate-by-height` class which set display to `inline-block`. See  
[https://github.com/elastic/kibana/blob/master/src/ui/public/doc\_table/components/table\_row.js#L164](https://github.com/elastic/kibana/blob/master/src/ui/public/doc_table/components/table_row.js#L164)

- the color format is creating an inline `span` element. See [https://github.com/elastic/kibana/blob/master/src/core\_plugins/kibana/common/field\_formats/types/color.js#L24](https://github.com/elastic/kibana/blob/master/src/core_plugins/kibana/common/field_formats/types/color.js#L24)

Removing the `truncate-by-height` class (or at least the display property) and changing the color field format template to `div` instead of `span` highlight the full cell width.

Not sure how a good fix for that should be implemented. Maybe the truncate arguments should be defined per field formats ? Also comparison of the formatted output length may contains HTML so it does not make much sense see `text.length > MIN_LINE_LENGTH` maybe checking with the initial raw value is better ?

Thanks

Francois

Related discussion [Cell Backgroud color instead of field text fore/back color](https://discuss.elastic.co/t/cell-backgroud-color-instead-of-field-text-fore-back-color/59454/3)

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [October 15, 2018, 6:12pm UTC](https://discuss.elastic.co/t/cell-background-color-instead-of-text-only/152492/2 "2018-10-15T18:12:05Z")

</div>

Agree it would make a great enhancement. There was some prior work that didn't quite make it all the way in [here](https://github.com/elastic/kibana/pull/12067).

---

<div class="post-metadata">

**Author:** ![fxprunayre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fxprunayre/32/22478_2.png) [@fxprunayre](https://discuss.elastic.co/u/fxprunayre)\
**Post date:** [October 16, 2018, 1:55pm UTC](https://discuss.elastic.co/t/cell-background-color-instead-of-text-only/152492/3 "2018-10-16T13:55:23Z")

</div>

Thanks for the link. It is also discussed in [https://github.com/elastic/kibana/issues/9834](https://github.com/elastic/kibana/issues/9834)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 13, 2018, 2:09pm UTC](https://discuss.elastic.co/t/cell-background-color-instead-of-text-only/152492/4 "2018-11-13T14:09:42Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
