6

How do I change the background color of one cell or one row of a table?

I can only seem to change the background color of the entire table in draw.io yet shapes exist that have some of he other cells colored differently?

I'm just trying to get a shape with a table that has a heading with a different background color so if there's any other way to do this that would be helpful as well.

  • 2
    Can you edit the html of the table? – AccioBooks Jan 23 '16 at 1:33
  • Until now, I did not know that button existed. This definitely helps in trying to solve complex tasks. – Coburn Jan 23 '16 at 15:22
6

It's a pain. If you double-click the table to enter 'edit mode', you view the HTML for the table, by clicking the HTML button in the top toolbar. enter image description here (This is only visible when editing an entity.) The table styles are done inline. And the HTML is unformatted so it all just shows up on one line.

For example, if you use the 'green' table in the 'Misc' panel, you can search for:

<tr style="background-color: #eaf2d3 ; border: 1px solid #98bf21">

and change the color to what ever you want. But this only changes that specific row.

If your using Draw.io online, you can at least take advantage of the browser's native search in page function ('CMD+F' or 'CTL+F') to find and replace the color string.

I havn't figured out to search with the desktop/chromeapp version.

Edit: After playing around a bit, I found it was much easier to build your own table just using a group of rectangles.

After arranging the rectangles with correct height and width, group them. 'Arrange -> Group' or 'CTL+G'. The group allows the table to be moved around as one object, instead of individual entities.

You can then select Rows or Columns just by dragging a selection rectangle. You can tab through all the fields, and just start typing.

It's much easier than trying to use the pre-built examples.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.