Question & Answer: Using CSS selectors, create a table which alternates the shading of each row between two shades of gra…..

1. Using CSS selectors, create a table which alternates the shading of each row between two shades of gray Using what you have learned this week, create two separate sample navigational buttons for a webpage. You can use any property you saw this week (border-image, border-radius, background-clip, box-shadow), and you can mix and match them as well. 2.

Using CSS selectors, create a table which alternates the shading of each row between two shades of gray. Using what you have learned this week, create two separate sample navigational buttons for a webpage. You can use any property you saw this week (border-image, border-radius, background-clip, box-shadow), and you can mix and match them as well.

Expert Answer

 

A1. CSS for different color

<!DOCTYPE html>
<html>
<head>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}

td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}

tr:nth-child(even) {
background-color: #808080;
}
tr:nth-child(odd) {
background-color: #c0c0c0;
}
</style>
</head>
<body>

<table>
<tr>
<th>Company</th>
<th>Position</th>
<th>Department</th>
</tr>
<tr>
<td>Alfreds Anders</td>
<td>Developer</td>
<td>Software</td>
</tr>
<tr>
<td>Maria Moctezuma</td>
<td>Manual Testing</td>
<td>Software and Tessting</td>
</tr>
<tr>
<td>Roland Handel</td>
<td>Manager</td>
<td>HR Resources</td>
</tr>
<tr>
<td>Island Bennett</td>
<td>Senior Manager</td>
<td>Global Resources</td>
</tr>
<tr>
<td>Yoshi Tannamuri</td>
<td>Programer</td>
<td>Software</td>
</tr>
<tr>
<td>Magazzini Rovelli Riuniti</td>
<td>Automation Testing</td>
<td>Software and Tessting</td>
</tr>
</table>

</body>
</html>

A2. Navigation through button and border styles. <! To try this save A1 and A2 in seperate html files in same folder only you will see the navigation effect.>

<!DOCTYPE html>
<html>
<head>
<script>
function myFunction() {
window.location=”Hands-on1.html”;
}
</script>

<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}

td, th {
border: 2px solid black;
text-align: center;
padding: 8px;
border-radius: 15px;
box-shadow: 15px 5px;
}

tr:nth-child(even) {
background-color: #808080;
}
tr:nth-child(odd) {
background-color: #c0c0c0;
}
</style>
</head>
<body>

<table>
<tr>
<th>Company</th>
<th>Position</th>
<th>Department</th>
</tr>
<tr>
<td>Alfreds Anders</td>
<td>Developer</td>
<td>Software</td>
</tr>
<tr>
<td>Maria Moctezuma</td>
<td>Manual Testing</td>
<td>Software and Tessting</td>
</tr>
<tr>
<td>Roland Handel</td>
<td>Manager</td>
<td>HR Resources</td>
</tr>
<tr>
<td>Island Bennett</td>
<td>Senior Manager</td>
<td>Global Resources</td>
</tr>
<tr>
<td>Yoshi Tannamuri</td>
<td>Programer</td>
<td>Software</td>
</tr>
<tr>
<td>Magazzini Rovelli Riuniti</td>
<td>Automation Testing</td>
<td>Software and Tessting</td>
</tr>
<tr>
<td colspan=3> <input type=”button” value=”Navigate” onclick=”myFunction();” />
</td>
</tr>
</table>

</body>
</html>

Still stressed from student homework?
Get quality assistance from academic writers!