Table within class

0 votes
asked Feb 12, 2019 in Bug by ellef (120 points)
How can I insert a multi-line table, e.g. a value table, inside a class?

The code below results in two tables (instead of two rows of the same table)

class A{
   Normal attribute
   | header left | header right |
   | row left | row right |
 }

According to http://plantuml.com/creole, creole should work in all diagram types.

1 Answer

0 votes
answered Feb 12, 2019 by Serge Wenger Work (13,280 points)

You must put all on the same line:

@startuml
class A{
   Normal attribute
   | header left | header right |\n| row left | row right |
 }
@enduml

http://www.plantuml.com/plantuml/png/SoWkIImgAStDuKhEIImkLd2ivb9GKF3BByfDp558B2afoamgBKa5YTKePAGcfgGMAUIaffKWU4MPwHb0RanUZK9HVZb44io4oN0fr78vfEQb0Eq00000

commented Nov 8, 2019 by valexiev (1,000 points)
Well, that really sucks. I also cannot make the first row normal (it's always a bolded header).

I'd rather use a fixed-width font or \t to align attribute descriptions in classes, although \t is not robust : you have to guess how many tabs to put in
commented Nov 8, 2019 by Serge Wenger Work (13,280 points)

 Well, that really sucks. I also cannot make the first row normal (it's always a bolded header).

I think it is by design 

For the second point, as workaround you can put an image

http://www.plantuml.com/plantuml/png/HOf1JWCn34NtSuge-qn6B5XK29KBS08sRc8o4OuTEOu2ejoTLW9rzzz_xzGDr4Qb9HBqxbw-5-VSgsW5Sc2cvJmCRz_5xGW9rH6-svsqvFsARtnnAlDVtkQVMGvFfURZRjQE8SmvLqmb5mE2Z1o_rYXrXH5cyr7Oa2sCHWAfXrw1o6UHJEX9ilZ6sPi2zmQARFuCyIEh34x-STi-7xPjlIRFXyNzB2VaD2hz0W00

...