Created
February 23, 2014 16:01
-
-
Save sandeep-datta/9173221 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| //HTML | |
| //<div id="container"/> | |
| //CSS | |
| //table,td {border: 1px solid black;} | |
| JAVASCRIPT | |
| function createHLayout() { | |
| var row = $('<tr/>') | |
| var table = $('<table/>') | |
| table.append(row); | |
| return table; | |
| } | |
| function addToHLayout(hlayout, elem) { | |
| var data = $('<td/>') | |
| data.append(elem); | |
| hlayout.find('tr').first().append(data); | |
| } | |
| var hl = createHLayout(); | |
| addToHLayout(hl, $('<div>A1</div>')) | |
| addToHLayout(hl, $('<div>A2</div>')) | |
| $('#container').append(hl); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment