हिंदी

Write the HTML code for the following table: Year 1999 2000 2001 Sales Units 300 750 1200 Income Rs. 3000 Rs. 7500 Rs. 12000 - Computer Science 1

Advertisements
Advertisements

प्रश्न

Write the HTML code for the following table:

  Year
1999 2000 2001
Sales Units 300 750 1200
Income Rs. 3000 Rs. 7500 Rs. 12000
कोड लेखन
Advertisements

उत्तर

<!DOCTYPE html>
<html>
<head>
    <title>Sales Table</title>
</head>
<body>

<table border="1" cellpadding="8" cellspacing="0">
    <tr>
        <th rowspan="2"></th>
        <th colspan="3">Year</th>
    </tr>
    <tr>
        <th>1999</th>
        <th>2000</th>
        <th>2001</th>
    </tr>
    <tr>
        <th rowspan="2">Sales</th>
        <th>Units</th>
        <td>300</td>
        <td>750</td>
        <td>1200</td>
    </tr>
    <tr>
        <th>Income</th>
        <td>Rs. 3000</td>
        <td>Rs. 7500</td>
        <td>Rs. 12000</td>
    </tr>
</table>

</body>
</html>

Key Points Used:

  • colspan="3" for Year
  • rowspan="2" for Sales
  • Proper <th> and <td> tags
  • Border added for table visibility
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2024-2025 (July) Official Board Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×