Monday, 24 May 2021

WT-30

 

Q1. Write a JavaScript program to construct the following pattern up to n lines, using a nested for loop.                                                                                                                                        

A

B         C

D         E          F

 

<html>

<head>

<script type="text/javascript">

var i, j, k = 65;

for(i=65; i<=67; i++)

{

for(j=65; j<=i; j++)

document.write(String.fromCharCode(k++) +" ");

document.write("<br>");

}

</script>

</head>

<body>

</body>

</html>

 

Q2. Write a HTML code to create the following table. Use External CSS to format the table.

 

College/Courses

Arts

Commerce

UG

PG

UG

PG

D. Y. Patil, Pimpri

BA

MA

B.Com

M.Com

Indira College

BA

MA

BBA(CA)

MCA(Commerce)

Wadia College

BA

MA

B.Com

M.Com(Ecommerce)

 

<html>

<head>

<link rel="stylesheet" href="mystyle.css">

</head>

<body>

<table width="50%" align="left" cellpadding="5" cellspacing="2"  border="3">

<tr>

<td rowspan="2">College/Courses</td>

<td colspan="2">Arts</td>

<td colspan="2">Commerce</td>

</tr>

 

<tr align="center">

<td width="25%"><b>UG</b></td>

<td><b>PG</b></td>

<td><b>UG</b></td>

<td><b>PG</b></td>

</tr>

<tr>

<td>D. Y. Patil, Pimpri</td>

<td>BA</td>

<td>MA</td>

<td>B.Com</td>

<td>M.Com</td>

</tr>

<tr>

<td>Indira College</td>

<td>BA</td>

<td>MA</td>

<td>BBA(CA)</td>

<td>M.com (Commerce)</td>

</tr>

<tr>

<td>Wadia College</td>

<td>BA</td>

<td>MA</td>

<td>B.Com</td>

<td>M.Com(Ecommerce)</td>

</tr>

</table>

</body>

</html>

  

mystyle.css

body {background-color: lightblue;}