Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

how to change background color in a table

0 votes
I found that I can easyly create tables using title block (which is by the way little bit strange for me).
But don't know how to change the background color for the certain row, or how to turn odd/even coloring.
Example of simple table
|= |= table |= header |
| a | table | row |
| b | table | row |
end title
asked Jan 27, 2016 by mirecg (160 points)

1 Answer

0 votes

You cannot with current release.

However, we like the idea, so with last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

You can now have:

|= |= table |= header |
| a | table | row |
|<#FF8080> red |<#80FF80> green |<#8080FF> blue |
<#yellow>| b | table | row |


Is this what you are looking for ?

answered Jan 27, 2016 by plantuml (125,210 points)
It even works when I place the color in front of a row, which sets background color for the whole row.

Would you mind to allow named colors and to support odd-even rows coloring automatically?
Named colors is possible and working in the beta (see example with <#yellow> )

For odd-even rows colorings, the most difficult is to find a nice syntax.
Any suggestions ?
We could allow something like <odd:#yellow><even:#blue> in the table header ?
Oh, I did not notice the named color in the example, sorry :-)

The syntax for odd/even rows that you have proposed looks simple and quite well. Go for that. Thank you!

I must ask one thing. Why this must be placed in title - endtitle block?
It's great, but shouldn't it be documented, for example in creole ?
Sure, we've just updated the page http://plantuml.com/creole
The documentation is not always up to date, so do not hesitate to ping us again when you will find other missing point.

Thanks again!
Support This Project Offer 250 Mo! Follow PlantUML on Twitter