# Color an Excel Table

**URL:** <https://forum.knime.com/t/color-an-excel-table/13722>\
**Category:** KNIME Analytics Platform\
**Created:** [March 5, 2019, 5:07pm UTC](https://forum.knime.com/t/color-an-excel-table/13722 "2019-03-05T17:07:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![razvancomanici](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/r/a183cd/32.png) [@razvancomanici](https://forum.knime.com/u/razvancomanici)\
**Post date:** [March 5, 2019, 5:07pm UTC](https://forum.knime.com/t/color-an-excel-table/13722/1 "2019-03-05T17:07:36Z")

</div>

Hello!

Very little time I use the web server.

My problem is that I have to send information to some people in Excel. But before that I want to color the table head.

How do I do that?

Thanks!  
Razvan

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [March 5, 2019, 5:12pm UTC](https://forum.knime.com/t/color-an-excel-table/13722/2 "2019-03-05T17:12:10Z")

</div>

You could use Python to do that. Or you could reference the data in excel from a separate sheet while the formatted one stays the same

Python Excel manipulation

> [@write data to excel sheet on row 10](https://forum.knime.com/t/write-data-to-excel-sheet-on-row-10/12897/6):
>
> well … there is a way. You could use the Python module [openpyxl](https://openpyxl.readthedocs.io/en/stable/) and open the stored excel file in Python and do some manipulations and then save it again. Openpyxl offers a wide range of possibilities. Please be aware that this might not be the most stable way, and it could get tricky if you have large or complicated Excel files. [kn\_example\_python\_excel\_manipulate.knar](https://forum-cdn.knime.com/uploads/default/original/2X/2/2bd1b798f1fee3fa8d4d122c3b648bd5f8ab0de4.knar) (54.5 KB)

Python Excel Drop Down

> [@DataValidation Drop down list in Excel using Python Scrpt node](https://forum.knime.com/t/datavalidation-drop-down-list-in-excel-using-python-scrpt-node/12648/6):
>
> I attached a workflow that uses your example to create an Excel file via Python. And also one from the example from before. I think you have to provide the Python Script with a valid path (in this case I used the path of the workflow) and you have to close the file at the end. [image] [kn\_example\_python\_excel\_drop\_down.knwf](https://forum-cdn.knime.com/uploads/default/original/2X/3/3d87b7fc29d1017c801cafcd1bf67f72f7c49e9a.knwf) (21.4 KB)

---

<div class="post-metadata">

**Author:** ![razvancomanici](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/r/a183cd/32.png) [@razvancomanici](https://forum.knime.com/u/razvancomanici)\
**Post date:** [March 5, 2019, 5:21pm UTC](https://forum.knime.com/t/color-an-excel-table/13722/3 "2019-03-05T17:21:23Z")

</div>

Thank for the information!

---

<div class="post-metadata">

**Author:** ![matthias.albus](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@matthias.albus](https://forum.knime.com/u/matthias.albus)\
**Post date:** [March 6, 2019, 7:01am UTC](https://forum.knime.com/t/color-an-excel-table/13722/4 "2019-03-06T07:01:56Z")

</div>

There is also a perhaps more out “of the box” solution; install the erlwood extensions (part of the community contributions of knime). They offer a “coloured xls writer node”.

best

Matthias

---

<div class="post-metadata">

**Author:** ![agaunt](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/ea666f/32.png) [@agaunt](https://forum.knime.com/u/agaunt)\
**Post date:** [March 7, 2019, 12:08pm UTC](https://forum.knime.com/t/color-an-excel-table/13722/5 "2019-03-07T12:08:24Z")

</div>

Hi @razvancomanici, you could also try the BIRT Report. Just connect the table you want to write to Excel to a Data to Report node and click the Report button ([https://docs.knime.com/latest/report\_designer\_user\_guide/img/02\_report\_icon.png](https://docs.knime.com/latest/report_designer_user_guide/img/02_report_icon.png)). Then you drag and drop the data set from the Data set view to the layout window and color the header. Finally you click Run -\> View Report -\> As XLSX and you’re done. Nice add on: Even zebra-styled tables are possible. Therefore you click on the table in the Layout window, click the button with the orange lines on it, click on the “Highlights” tab on the bottom and add the condition “row.\_\_rownum%2 Equal to 0”. Then you can choose a different background color for every second row.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 23, 2023, 8:32pm UTC](https://forum.knime.com/t/color-an-excel-table/13722/6 "2023-06-23T20:32:53Z")

</div>


