In [ ]:
// cell1
["x" : 1, "y" : 2]

In [ ]:
// cell1 expected result
Image("../../resources/img/groovy/mapLikeTable/cell1_case1.png")

In [ ]:
// cell2
List list = new ArrayList();
list.add(["x" : 1, "y" : 2]);
list.add(["x" : 3, "y" : 4]);
list

In [ ]:
// cell2 expected result
Image("../../resources/img/groovy/mapLikeTable/cell2_case1.png")

In [ ]:
// cell3
Map[] map = new Map[2];
map[0] = ["x" : 1, "y" : 2]
map[1] = ["x" : 3, "y" : 4]
map

In [ ]:
// cell3 expected result
Image("../../resources/img/groovy/mapLikeTable/cell3_case1.png")

In [ ]:
// cell4
def listOfMap = []
1.upto(3){
    listOfMap += ["test": it, "test2": 2 * it]
}
listOfMap

In [ ]:
// cell4 expected result
Image("../../resources/img/groovy/mapLikeTable/cell4_case1.png")

In [ ]:
// cell5
def myMap = [:]
def myList = []
myList << [1, 2, 3]
myList << [2, 3, 4]
myMap.put(1, myList)
myMap

In [ ]:
// cell5 expected result
Image("../../resources/img/groovy/mapLikeTable/cell5_case1.png")

In [ ]:
// cell6
def myMap = [:]
def myList = [num1:1, num2:2]
myMap.put(1, myList)
myMap

In [ ]:
// cell6 expected result
Image("../../resources/img/groovy/mapLikeTable/cell6_case1.png")

In [ ]:
// cell7
new TableDisplay([[col1: "This & that", col2: "This / that", col3: "This > that"]]);

In [ ]:
// cell7 expected result
Image("../../resources/img/groovy/mapLikeTable/cell7_case1.png")

In [ ]:
// cell8
class MyClass {
    def value;
    public MyClass(String value) {
        this.value = value
    }
    
    public String toString() {
        return this.value;
    }
}

def clz = new MyClass("print this")
def tableData = [
   [myclass:  clz]
]
displayObject = new TableDisplay(tableData);
displayObject

In [ ]:
// cell8 expected result
Image("../../resources/img/groovy/mapLikeTable/cell8_case1.png")

In [ ]: