For Advertisements on this blog Contact Us at developgram@gmail.com or +91-9923438816

Simple Programming Tutorials For Beginners

Example

Q. Write a HTML code to print the following tables:





Ex1:
<html>
  <body>
    <table border="5" cellspacing="3" cellpadding="5">
      <th colspan="8" height="50">
        Player Details
      </th>
      <tr>
        <td rowspan="2">Sr. No.</td>
        <td rowspan="2">Name</td>
        <td colspan="3" align="center">Test Matches</td>
        <td colspan="3" align="center">One Day Matches</td>
      </tr>
      <tr>
        <td>WKT</td>
        <td>Over</td>
        <td>Runs</td>
        <td>WKT</td>
        <td>Over</td>
        <td>Runs</td>
      </tr>
      <tr>
        <td>1</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td>2</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
    </table>
  </body>
</html>

Ex2:
<html>
  <body>
    <table border="5" cellspacing="3" cellpadding="5">
      <th colspan="5">Invoice</th>
      <tr>
        <td colspan="2" style="padding-bottom:3em"><b>Date: 19<sup>th</sup> Jan 2017</b></td>
        <td colspan="3" align="right" style="padding-top:1em"><b>Page No<br />1 of 3</b></td>
      </tr>
      <tr>
        <td><b>Serial No.</b></td>
        <td><b>Particulars</b></td>
        <td><b>Rate</b></td>
        <td><b>Quantity</b></td>
        <td align="right"><b>Price</b></td>
      </tr>
      <tr>
        <td>1</td>
        <td>Pen</td>
        <td align="right">30</td>
        <td align="right">40</td>
        <td align="right">1200</td>
      </tr>
      <tr>
        <td>2</td>
        <td>Pencil</td>
        <td align="right">30</td>
        <td align="right">20</td>
        <td align="right">600</td>
      </tr>
      <tr>
        <td colspan="4" align="right"><b>Total Amount</b></td>
        <td align="right"><b>1800</b></td>
      </tr>
      <tr>
        <td colspan="5"><b>Amount (in words) - </b></td>
      </tr>
      <tr>
        <td colspan="4">Prepared by</td>
        <td align="right" style="padding-left:4em"> Signature</td>
      </tr>
    </table>
  </body>
</html>

Ex3:
<html>
  <body>
    <table border="5" cellspacing="3" cellpadding="5" height="250" width="500" style="text-align: center; font-size: 25px;">
      <tr>
        <td colspan="2">1</td>
        <td>2</td>
        <td>3</td>
      </tr>
      <tr>
        <td>4</td>
        <td>5</td>
        <td>6</td>
        <td>7</td>
      </tr>
      <tr>
        <td colspan="4">8</td>
      </tr>
      <tr>
        <td>9</td>
        <td colspan="2">10</td>
        <td>11</td>
      </tr>
    </table>
  </body>
</html>

Ex4:
<html>
  <body>
    <table border="5" cellspacing="3" cellpadding="5" style="text-align: center; font-size: 17px;">
      <tr>
        <td>UHS</td>
        <td colspan="6">State</td>
      </tr>
      <tr>
        <td rowspan="2">Year</td>
        <td colspan="2">Maharashtra</td>
        <td colspan="2">Gujrat</td>
        <td colspan="2">UP</td>
      </tr>
      <tr>
        <td>Bajaj</td>
        <td>Hero<br/>Honda</td>
        <td>Kinetic</td>
        <td>Bajaj</td>
        <td>Hero<br/>Honda</td>
        <td>Bajaj</td>
      </tr>
      <tr>
        <td>2001-02</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td>2002-03</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td>2003-04</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td>2004-05</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
    </table>
  </body>
</html>

1 comment:

  1. Awesome bro keep up the great work......thank you

    ReplyDelete

SEARCH THIS BLOG