Is it possible to add a tooltip containing component in Vaadin? -


i need display tooltip contains table. table exist customcomponent. 1 of solutions duplicate table in html , use setdescription() method. looks little ugly, on opinion.

what mean ugly? @ examples @ vaadin book - nice.

i tried put table button description.

button b = new button("button"); b.seticon(fontawesome.legal); b.addstylename(valotheme.button_friendly);  b.setdescription(         "<table>\n" +         "  <tr>\n" +         "    <th style=\"padding: 10px;\">month</th>\n" +         "    <th style=\"padding: 10px;\">savings</th>\n" +         "  </tr>\n" +         "  <tr>\n" +         "    <td style=\"padding: 10px;\">january</td>\n" +         "    <td style=\"padding: 10px;\">$100</td>\n" +         "  </tr>\n" +         "  <tr>\n" +         "    <td style=\"padding: 10px;\">july</td>\n" +         "    <td style=\"padding: 10px;\">$342</td>\n" +         "  </tr>\n" +         "  <tr>\n" +         "    <td style=\"padding: 10px;\">november</td>\n" +         "    <td style=\"padding: 10px;\">$0</td>\n" +         "  </tr>\n" +         "</table>\n"         ); 

i use valo theme. , result is:

enter image description here

it has size issue because <th> , <td> have padding. simple increase table size makes better:

<table style=\"width:20em\"> 

enter image description here

you can customize in way. example added border:

enter image description here

you can customize whole tooltip using scss.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -