How to create a table with zebra-striped rows using inline styles in HTML

0 votes
With the help of code can you tell me How to create a table with zebra-striped rows using inline styles in HTML?
Mar 19 in HTML by Ashutosh
• 23,230 points
54 views

1 answer to this question.

0 votes

To create a zebra-striped table using inline styles, apply different background colors to alternating rows manually.

Example:

<table border="1">

  <tr style="background-color: #f2f2f2;">

    <th>Name</th>

    <th>Age</th>

  </tr>

  <tr>

    <td>Alice</td>

    <td>25</td>

  </tr>

  <tr style="background-color: #f2f2f2;">

    <td>Bob</td>

    <td>30</td>

  </tr>

  <tr>

    <td>Charlie</td>

    <td>28</td>

  </tr>

</table>

answered 4 days ago by anonymous

Related Questions In HTML

0 votes
0 answers

How to create a vertical line in HTML?

I need to create a vertical line ...READ MORE

Jul 4, 2022 in HTML by Tejashwini
• 3,820 points
809 views
0 votes
0 answers

How to create nested table in html ?

I need to make an HTML table ...READ MORE

Jul 8, 2022 in HTML by Tejashwini
• 3,820 points
649 views
0 votes
0 answers

How to do calculation in PHP using a csv file for retrieving data?

Morning, I have a csv file and i ...READ MORE

Feb 11, 2020 in HTML by anonymous
• 140 points
1,544 views
0 votes
0 answers

How to insert spaces/tabs in text using HTML/CSS

how to add space in HTML except ...READ MORE

Jun 3, 2022 in HTML by Tejashwini
• 3,820 points
439 views
0 votes
0 answers
0 votes
1 answer

How can I override Bootstrap CSS styles?

You can override Bootstrap CSS styles using ...READ MORE

answered 4 days ago in Node-js by anonymous
41 views
0 votes
1 answer

How to make text center in Hero image with bootstra

You can use a combination of Bootstrap's ...READ MORE

answered 4 days ago in Node-js by anonymous
43 views
0 votes
0 answers

How to add a dropdown submenu in Bootstrap 3 navigation?

Can you tell me How to add ...READ MORE

Mar 19 in Node-js by Ashutosh
• 23,230 points
41 views
0 votes
1 answer

How to create a hidden input field in a form in HTML?

You can use the type attribute with ...READ MORE

answered 4 days ago in HTML by anonymous
45 views
0 votes
1 answer

How to limit the number of digits in an input HTML?

For text-based inputs such as <input type="text"> ...READ MORE

answered Dec 17, 2024 in HTML by Navya
122 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP