Wednesday, 5 May 2021

JQUERY7

 

<html>

<head>

<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

 <script>

$(document).ready(function(){

$("tr:odd").addClass("zebra");

});

</script>

<style type="text/css">.table_style{

width: 500px;

margin: 0px auto;

}

table{

width: 100%;

}

table tr td{

width: 40%;

border: 1px solid

pink;

padding: 5px;

}

table tr th{

border: 1px solid

skyblue;

padding: 5px;

}

.zebra{

background-color: 

LightSalmon;

}

</style>

 

</head>

<body>

<div class="table_style">

<table>

<caption> <h1>Student List</h1> </caption>

<tr>

<th>Student Name</th>

<th>Course</th>

</tr>

<tr>

<td>Adhira</td>

<td>FYBCA</td>

</tr>

<tr>

<td>Abira</td>

<td>SYBCA</td>

</tr>

<tr>

<td>Akira</td>

<td>TYBCA</td></tr>

 </table>

</div>

</body>

</html>