"Striped table 3.0"
Bootstrap 3.0.0 Snippet by innovationLab

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row col-md-6 col-md-offset-2 custyle"> <table id="tableDiv" class="table table-striped custab"> <tr> <th>ID</th> <th>Title</th> <th>Parent ID</th> <th class="text-center">Action</th> </tr> <tr> <td>1</td> <td>News</td> <td>News Cate</td> <td class="text-center"><input class='btn btn-info btn-xs' type=submit value="click me"></td> </tr> </table> </div> </div>
.custab{ border: 1px solid #ccc; padding: 5px; margin: 5% 0; box-shadow: 3px 3px 2px #ccc; transition: 0.5s; } .custab:hover{ box-shadow: 3px 3px 0px transparent; transition: 0.5s; }
window.onload = function () { parseData(); } var domains = '{ "domains" : [' + '{ "domainName":"www.facebook.com" },' + '{ "domainName":"www.twitter.com" },' + '{ "domainName":"www.googleplus.com" },' + '{ "domainName":"www.google.com" },' + '{ "domainName":"www.google.com"} ]}'; function parseData(){ var obj = JSON.parse(domains); var newTable,startTag,endTag; //Creating a new table startTag="<TABLE id=\"tableDiv\" class=\"table table-striped custab\"><TR><TH>Domain</TH></TR>" endTag="</TABLE>" newTable=startTag; var trContents; for(i=0;i<obj.domains.length;i++){ newTable+="<TR><TD>" + obj.domains[i].domainName + "</TD>" + "<td class=\"text-center\"><input class='btn btn-info btn-xs' type=submit value=\"click me\">" + "</td>" + "</TR>"; } newTable+=endTag; document.getElementById('tableDiv').innerHTML=newTable; }

Related: See More


Questions / Comments: