1616 margin-top : 50px ;
1717 }
1818
19- # placeholder {
19+ . placeholder {
2020 width : 100% ;
2121 height : 500px ;
2222 background-color : # fff ;
2828</ head >
2929
3030< body onresize ="doResize() ">
31- < h1 > ESM Quick Test </ h1 >
32- < div id ="placeholder "> </ div >
31+ < h2 > Nested Table </ h2 >
32+ < div id ="placeholder1 " class =" placeholder "> </ div >
3333 < script type ="module ">
3434 import { Table } from "./src/index.ts" ;
3535
3636 window . __table = new Table ( )
37- . target ( "placeholder " )
37+ . target ( "placeholder1 " )
3838 . columns ( [ "Mother" , "Father" , { label : "Children" , columns : [ "Name" , "sex" , "age" ] } , { label : "Pets" , columns : [ "Name" , "type" ] } ] )
3939 . data ( [
4040 [ "<b>Jane</b>" , "John" , [ [ "Mary" , "f" , 4 ] , [ "Bob" , "m" , 6 ] , [ "Tim" , "m" , 1 ] ] , [ [ "Spot" , "dog" ] , [ "Smelly" , "cat" ] , [ "Goldie" , "Fish" ] , [ "Hammy" , "Hamster" ] ] ] ,
@@ -46,9 +46,36 @@ <h1>ESM Quick Test</h1>
4646 . render ( )
4747 ;
4848 </ script >
49+ < h2 > Resize Handle</ h2 >
50+ < div id ="placeholder2 " class ="placeholder "> </ div >
51+ < script type ="module ">
52+ import { Table } from "./src/index.ts" ;
53+
54+ window . __table2 = new Table ( )
55+ . target ( "placeholder2" )
56+ . columns ( [ "Subject" , "Year 1" , "Year 2Year 2Year 2" , "Year 3" , "Year 4" ] )
57+ . data ( [
58+ [ "English" , 5 , 43 , 41 , 92 ] ,
59+ [ "English II" , 17 , 43 , 83 , 93 ] ,
60+ [ "English III" , 6 , 43 , 64 , 93 ] ,
61+ [ "Geography" , 7 , 45 , 52 , 83 ] ,
62+ [ "Geography II" , 16 , 73 , 52 , 83 ] ,
63+ [ "Geography III" , 26 , 83 , 11 , 72 ] ,
64+ [ "Science" , 66 , 60 , 85 , 6 ] ,
65+ [ "Science II" , 46 , 20 , 53 , 7 ] ,
66+ [ "Science III" , 46 , 20 , 38 , 7 ] ,
67+ [ "Math" , 98 , 30 , 23 , 13 ] ,
68+ [ "Math II" , 76 , 30 , 34 , 6 ] ,
69+ [ "Math III" , 80 , 30 , 27 , 8 ]
70+ ] )
71+ . pagination ( true )
72+ . render ( )
73+ ;
74+ </ script >
4975 < script >
5076 function doResize ( ) {
5177 window . __table ?. resize ( ) ?. render ( ) ;
78+ window . __table2 ?. resize ( ) ?. render ( ) ;
5279 }
5380 </ script >
5481</ body >
0 commit comments