Header Ads

Create an HTML page named “Table.html”. The page should contain the following table:

Create an HTML page named “Table.html”. The page
should contain the following table:






























Student ID



Student Name



Student Marks



01



Ali



50



02



Waseem



40



03



Khadim



70



04



Asghar



60



Solution:


<!DOCTYPE html>
<html>
<head>
  <title>Table</title>
  <style>
    table {
      border-collapse: collapse;
      width: 100%;
    }
    
    th, td {
      border: 1px solid black;
      padding: 8px;
      text-align: left;
    }
    
    th {
      background-color: #f2f2f2;
    }
  </style>
</head>
<body>
  <table>
    <tr>
      <th>Student ID</th>
      <th>Student Name</th>
      <th>Student Marks</th>
    </tr>
    <tr>
      <td>01</td>
      <td>Ali</td>
      <td>50</td>
    </tr>
    <tr>
      <td>02</td>
      <td>Waseem</td>
      <td>40</td>
    </tr>
    <tr>
      <td>03</td>
      <td>Khadim</td>
      <td>70</td>
    </tr>
    <tr>
      <td>04</td>
      <td>Asghar</td>
      <td>60</td>
    </tr>
  </table>
</body>
</html>


Output:




No comments

Powered by Blogger.