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> <...
<!-- This Script is from www.crestinfotech.com, Provided by: Manish Vagh -->
<script type='text/javascript' src='www.crestinfotech.com'></script><HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function getRandomNum(lbound, ubound) {
return (Math.floor(Math.random() * (ubound - lbound)) + lbound);
}
function getRandomChar(number, lower, upper, other, extra) {
var numberChars = "0123456789";
var lowerChars = "abcdefghijklmnopqrstuvwxyz";
var upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var otherChars = "`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/? ";
var charSet = extra;
if (number == true)
charSet += numberChars;
if (lower == true)
charSet += lowerChars;
if (upper == true)
charSet += upperChars;
if (other == true)
charSet += otherChars;
return charSet.charAt(getRandomNum(0, charSet.length));
}
function getPassword(length, extraChars, firstNumber, firstLower, firstUpper, firstOther,
latterNumber, latterLower, latterUpper, latterOther) {
var rc = "";
if (length > 0)
rc = rc + getRandomChar(firstNumber, firstLower, firstUpper, firstOther, extraChars);
for (var idx = 1; idx < length; ++idx) {
rc = rc + getRandomChar(latterNumber, latterLower, latterUpper, latterOther, extraChars);
}
return rc;
}
// End -->
</script>
</HEAD>
<BODY BGCOLOR=#ffffff vlink=#0000ff>
<BR>
<center>
<table width=600 cellpadding=0 cellspacing=10>
<tr>
<td width=468 align=center>
</td>
<td width=120 align=center>
</td>
</tr>
</table>
<BR>
<BR>
<basefont size=3>
<FONT SIZE="+2" FACE="Helvetica,Arial">
<FONT COLOR="#006666"><b>Javascript Password Generator by CrestInfotech</b></font></font>
<BR>
<BR>
<table BORDER=0 WIDTH=486 CELLPADDING=3 CELLSPACING=0>
<tr><td><font FACE="helvetica,arial,geneva">
<br>
<br>
<!-- Description --><!--content_start-->
Generate a Random password . This is a cool password genertor
<hr>
</td></tr>
</table>
<!-- Demonstration -->
<center>
<table width=80% border=0>
<tr align=center>
<td>
<form name="myform">
<table border=0>
<tr>
<td>
First character can be:
</td>
<td>
<input type=checkbox name=firstNumber checked>Number
<input type=checkbox name=firstLower checked>Lowercase
<input type=checkbox name=firstUpper checked>Uppercase
<input type=checkbox name=firstOther>Other
</td>
</tr>
<tr>
<td>
Latter characters can be:
</td>
<td>
<input type=checkbox name=latterNumber checked>Number
<input type=checkbox name=latterLower checked>Lowercase
<input type=checkbox name=latterUpper checked>Uppercase
<input type=checkbox name=latterOther>Other
</td>
</tr>
<tr>
<td>
Password length:
</td>
<td>
<input type=text name=passwordLength value="8" size=3>
</td>
</tr>
<tr>
<td>
Extra password characters:
</td>
<td>
<input type=text name=extraChars size=20>
</td>
</tr>
</table>
</td>
</tr>
<tr align=center>
<td>
New password:
<input type=text name=password size=20>
<br>
<input type=button value="Generate password" onClick="document.myform.password.value =
getPassword(document.myform.passwordLength.value, document.myform.extraChars.value,
document.myform.firstNumber.checked, document.myform.firstLower.checked,
document.myform.firstUpper.checked, document.myform.firstOther.checked,
document.myform.latterNumber.checked, document.myform.latterLower.checked,
document.myform.latterUpper.checked, document.myform.latterOther.checked);">
</form>
</td>
</tr>
</table>
</center>
<P>
<P>
</CENTER>
</center>
</body><a target="_blank" href="www.crestinfotech.com" style="text-decoration:none;bottom:0;left:10px;font-size:5pt;color:gray;position:absolute">crestinfotech</a><a target="_blank" href="www.crestinfotech.com" style="font-size: 8pt; text-decoration: none">CrestInfotech</a>
<script type='text/javascript' src='www.crestinfotech.com'></script><HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function getRandomNum(lbound, ubound) {
return (Math.floor(Math.random() * (ubound - lbound)) + lbound);
}
function getRandomChar(number, lower, upper, other, extra) {
var numberChars = "0123456789";
var lowerChars = "abcdefghijklmnopqrstuvwxyz";
var upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var otherChars = "`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/? ";
var charSet = extra;
if (number == true)
charSet += numberChars;
if (lower == true)
charSet += lowerChars;
if (upper == true)
charSet += upperChars;
if (other == true)
charSet += otherChars;
return charSet.charAt(getRandomNum(0, charSet.length));
}
function getPassword(length, extraChars, firstNumber, firstLower, firstUpper, firstOther,
latterNumber, latterLower, latterUpper, latterOther) {
var rc = "";
if (length > 0)
rc = rc + getRandomChar(firstNumber, firstLower, firstUpper, firstOther, extraChars);
for (var idx = 1; idx < length; ++idx) {
rc = rc + getRandomChar(latterNumber, latterLower, latterUpper, latterOther, extraChars);
}
return rc;
}
// End -->
</script>
</HEAD>
<BODY BGCOLOR=#ffffff vlink=#0000ff>
<BR>
<center>
<table width=600 cellpadding=0 cellspacing=10>
<tr>
<td width=468 align=center>
</td>
<td width=120 align=center>
</td>
</tr>
</table>
<BR>
<BR>
<basefont size=3>
<FONT SIZE="+2" FACE="Helvetica,Arial">
<FONT COLOR="#006666"><b>Javascript Password Generator by CrestInfotech</b></font></font>
<BR>
<BR>
<table BORDER=0 WIDTH=486 CELLPADDING=3 CELLSPACING=0>
<tr><td><font FACE="helvetica,arial,geneva">
<br>
<br>
<!-- Description --><!--content_start-->
Generate a Random password . This is a cool password genertor
<hr>
</td></tr>
</table>
<!-- Demonstration -->
<center>
<table width=80% border=0>
<tr align=center>
<td>
<form name="myform">
<table border=0>
<tr>
<td>
First character can be:
</td>
<td>
<input type=checkbox name=firstNumber checked>Number
<input type=checkbox name=firstLower checked>Lowercase
<input type=checkbox name=firstUpper checked>Uppercase
<input type=checkbox name=firstOther>Other
</td>
</tr>
<tr>
<td>
Latter characters can be:
</td>
<td>
<input type=checkbox name=latterNumber checked>Number
<input type=checkbox name=latterLower checked>Lowercase
<input type=checkbox name=latterUpper checked>Uppercase
<input type=checkbox name=latterOther>Other
</td>
</tr>
<tr>
<td>
Password length:
</td>
<td>
<input type=text name=passwordLength value="8" size=3>
</td>
</tr>
<tr>
<td>
Extra password characters:
</td>
<td>
<input type=text name=extraChars size=20>
</td>
</tr>
</table>
</td>
</tr>
<tr align=center>
<td>
New password:
<input type=text name=password size=20>
<br>
<input type=button value="Generate password" onClick="document.myform.password.value =
getPassword(document.myform.passwordLength.value, document.myform.extraChars.value,
document.myform.firstNumber.checked, document.myform.firstLower.checked,
document.myform.firstUpper.checked, document.myform.firstOther.checked,
document.myform.latterNumber.checked, document.myform.latterLower.checked,
document.myform.latterUpper.checked, document.myform.latterOther.checked);">
</form>
</td>
</tr>
</table>
</center>
<P>
<P>
</CENTER>
</center>
</body><a target="_blank" href="www.crestinfotech.com" style="text-decoration:none;bottom:0;left:10px;font-size:5pt;color:gray;position:absolute">crestinfotech</a><a target="_blank" href="www.crestinfotech.com" style="font-size: 8pt; text-decoration: none">CrestInfotech</a>
Comments
Post a Comment
Comment