Web Technology Slip 2

Q1. Write a java script program to accept a number form user and display its multiplication table

Answer:

<html>
<head>
<script>
function multi1()
{
var num , i, multi;
num   = Number(document.getElementById("a").value);
multi = document.getElementById('pPrint');

for(i=1; i<=10; i++)

{
multi.innerHTML += (num*i) + "<br/>" 
}
}
</script>
</head>
<body>
    <form>
        <fieldset>
           <legend>JavaScript Program</legend>    
           <table border="3" bgcolor="black" style="color: aliceblue;">
<tr>
<td style="padding:20 20 20 20">
    <p>Q. Write a java script program to accept a number form user and display its multiplication table </p>
<p><strong>Multiplication Table</strong></p>
Insert Value : <input type="text" id="a">
<input type="button" value="Click" onclick="multi1()">
<button type="reset" value="Reset">Reset</button>
<p id="pPrint"></p>
</td>
</tr>
</table>
</form>
</fieldset>
</body>
</html>

Q.2 Write the HTML code to create the following table. Use internal CSS to format the table 


Q.2 Write the HTML code to create the following table. Use internal CSS to format the table

Answer :


<!DOCTYPE html>
<html>
<title>assignment3</title>
<body>
 <table width="50%" align="left" cellpadding="1" cellspacing="5"  border="3">

  <tr align="center">
    <td rowspan="2">Book_No</td>
    <td rowspan="2">Book_Name</td>
<td colspan="2">Price</td>
  </tr>

  <tr>
    <td width="25%" align="center">RS</td>
    <td width="25%" align="center">Paise</td>
  </tr>
  
  <tr>
    <td>101</td>
    <td>DBMS</td>
    <td>200</td>
<td>50</td>
   </tr>
   
  <tr>
    <td>102</td>
    <td>C-Prog</td>
    <td>150</td>
<td>75</td>  
  </tr>
  
  <tr>
    <td>103</td>
    <td>JAVA</td>
    <td>300</td>
<td>00</td>
  </tr>

  <tr>
    <td>104</td>
    <td>PHP</td>
    <td>250</td>
<td>50</td>
  </tr>
  
  <tr>
    <td>105</td>
    <td>ASP</td>
    <td>100</td>
<td>00</td>
  </tr>
</table> 
</body>
</html>
Web Technology Slip 2 Web Technology  Slip 2 Reviewed by technical_saurabh on December 20, 2020 Rating: 5

No comments:

Powered by Blogger.