Last active
May 16, 2017 22:31
-
-
Save php-coder/d3020e4d8d00b8c5befe755c46f06f1b to your computer and use it in GitHub Desktop.
How to do it in Thymeleaf?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Data from the database: | |
5 BMW Cars | |
2 Ford Cars | |
6 Fun NULL | |
1 Chess Sport | |
4 Football Sport | |
3 Rugby Sport | |
I'd like to show them as a <select> with <optgroup>'s **without** data transformation: | |
<select> | |
<optgroup label="Cars"> | |
<option value="5">BMW</option> | |
<option value="2">Ford</option> | |
</optgroup> | |
<option value="6">Fun</option> | |
<optgroup label="Sport"> | |
<option value="1">Chess</option> | |
<option value="4">Football</option> | |
<option value="3">Rugby</option> | |
</optgroup> | |
</select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment