Table data is normally repeatable by nature. ng-repeat directive can be used to draw table easily. Following example states the use of ng-repeat directive to draw a table. <table> <tr> <th> Name </th> <th> Marks </th> </tr> <tr ng-repeat = "subject in student.subjects" > <td> {{ subject.name }} </td> <td> {{ subject.marks }} </td> </tr> </table> Table can be styled using CSS Styling. <style> table , th , td { border : 1px solid grey ; border - collapse : collapse ; padding : 5px ; } table tr : nth - child ( odd ) { background - color : #f2f2f2; } table tr : nth - child ( even ) { background - color : #ffffff; } </style> Example Following example will showcase all the above mentioned directive. <html> <head> <...
<!DOCTYPE HTML>
<html>
<head><title>Sample</title>
<style type="text/css">
video.large {width:500px; display:none; position:absolute; z-index:2}
video.small {width:200px}
</style>
<script type="text/ecmascript">
var size = "small"
function maxRest(ID)
{
if (size == "small")
{
document.getElementById(ID).style.display = "inline";
size = "big";
}
else
{
document.getElementById(ID).style.display = "none";
size = "small";
}
}
</script>
</head>
<body>
<h1>Title of Gallery</h1>
<article>
<figure style="display:inline-block"><video src="small.ogv" id="I1A" onmouseleave="maxRest('I1A')" class="large" controls autoplay></video><video src="small.ogv" id="I1B" onmouseenter="maxRest('I1A')" class="small" controls autoplay></video><figcaption>Caption 1</figcaption></figure>
<figure style="display:inline-block"><video src="small.webm" id="I2A" onmouseleave="maxRest('I2A')" class="large" controls autoplay></video><video src="small.webm" id="I2B" onmouseenter="maxRest('I2A')" class="small" controls autoplay></video><figcaption>Caption 2</figcaption></figure>
<br>
<figure style="display:inline-block"><video src="small.ogv" id="I3A" onmouseleave="maxRest('I3A')" class="large" controls autoplay></video><video src="small.ogv" id="I3B" onmouseenter="maxRest('I3A')" class="small" controls autoplay></video><figcaption>Caption 3</figcaption></figure>
<figure style="display:inline-block"><video src="small.webm" id="I4A" onmouseleave="maxRest('I4A')" class="large" controls autoplay></video><video src="small.webm" id="I4B" onmouseenter="maxRest('I4A')" class="small" controls autoplay></video><figcaption>Caption 4</figcaption></figure>
</article>
</body>
</html>
<html>
<head><title>Sample</title>
<style type="text/css">
video.large {width:500px; display:none; position:absolute; z-index:2}
video.small {width:200px}
</style>
<script type="text/ecmascript">
var size = "small"
function maxRest(ID)
{
if (size == "small")
{
document.getElementById(ID).style.display = "inline";
size = "big";
}
else
{
document.getElementById(ID).style.display = "none";
size = "small";
}
}
</script>
</head>
<body>
<h1>Title of Gallery</h1>
<article>
<figure style="display:inline-block"><video src="small.ogv" id="I1A" onmouseleave="maxRest('I1A')" class="large" controls autoplay></video><video src="small.ogv" id="I1B" onmouseenter="maxRest('I1A')" class="small" controls autoplay></video><figcaption>Caption 1</figcaption></figure>
<figure style="display:inline-block"><video src="small.webm" id="I2A" onmouseleave="maxRest('I2A')" class="large" controls autoplay></video><video src="small.webm" id="I2B" onmouseenter="maxRest('I2A')" class="small" controls autoplay></video><figcaption>Caption 2</figcaption></figure>
<br>
<figure style="display:inline-block"><video src="small.ogv" id="I3A" onmouseleave="maxRest('I3A')" class="large" controls autoplay></video><video src="small.ogv" id="I3B" onmouseenter="maxRest('I3A')" class="small" controls autoplay></video><figcaption>Caption 3</figcaption></figure>
<figure style="display:inline-block"><video src="small.webm" id="I4A" onmouseleave="maxRest('I4A')" class="large" controls autoplay></video><video src="small.webm" id="I4B" onmouseenter="maxRest('I4A')" class="small" controls autoplay></video><figcaption>Caption 4</figcaption></figure>
</article>
</body>
</html>
Comments
Post a Comment
Comment