Computer Science, asked by satha34, 8 months ago

pls answer this question ​

Attachments:

Answers

Answered by sayantprasannan123
0

Answer:

<!DOCTYPE html>

<html>

<head>

<style>

table {

 border-collapse: collapse;

 width: 100%;

 background-color: lightblue;

}

th, td {

 text-align: left;

 padding: 8px;

}

tr:nth-child(even){background-color: white}

</style>

</head>

<body>

<h2>Student Marks Table</h2>

<table>

 <tr>

   <th>Student</th>

   <th>Subject 1</th>

   <th>Subject 2</th>

   <th>Subject 3</th>

   <th>Subject 4</th>

   <th>Subject 5</th>

 </tr>

 <tr>

   <td>Student 1</td>

   <td>80</td>

   <td>75</td>

   <td>85</td>

   <td>90</td>

   <td>95</td>

 </tr>

 <tr>

   <td>Student 2</td>

   <td>70</td>

   <td>65</td>

   <td>75</td>

   <td>80</td>

   <td>85</td>

 </tr>

 <tr>

   <td>Student 3</td>

   <td>60</td>

   <td>55</td>

   <td>65</td>

   <td>70</td>

   <td>75</td>

 </tr>

 <tr>

   <td>Student 4</td>

   <td>50</td>

   <td>45</td>

   <td>55</td>

   <td>60</td>

   <td>65</td>

 </tr>

 <tr>

   <td>Student 5</td>

   <td>40</td>

   <td>35</td>

   <td>45</td>

   <td>50</td>

   <td>55</td>

 </tr>

</table>

</body>

</html>

In this example, the table is created using the <table> element, and the table rows are defined using the <tr> element. The table cells are defined using the <td> element, and the table heading cells are defined using the <th> element.

The table is styled using CSS, with the border-collapse, width, and background-color properties applied to the table element, and the text-align and padding properties applied to the th and td elements. The tr:nth-child(even) selector is used to apply a white background color to every even-numbered row in the table.

I hope this helps! Let me know if you have any questions.

Similar questions