این محتوا تنها در این زبانها موجود است: عربي, English, Español, Français, Italiano, 日本語, 한국어, Русский, Українська, 简体中文. لطفاً به ما
Select all diagonal cells
اهمیت: 5
Write the code to paint all diagonal table cells in red.
You’ll need to get all diagonal <td>
from the <table>
and paint them using the code:
// td should be the reference to the table cell
td.style.backgroundColor = 'red';
The result should be:
We’ll be using rows
and cells
properties to access diagonal table cells.