Table with headers Attribute

Table with headers Attribute

Hard HTML Tables & Lists 28 views
Explanation Complexity

Problem Statement

Create a table where data cells reference header ids using the headers attribute.

Input Format

No input.

Output Format

Print the HTML code.

Constraints

Use id on th and headers on td.

Input / Output Format

Input Format
No input.
Output Format
Print the HTML code.
Constraints
Use id on th and headers on td.

Examples

Input:
Output:
(HTML code)

Example Solution (Public)

HTML
<!doctype html>
<html lang='en'>
<head>
  <meta charset='utf-8'>\
  <meta name='viewport' content='width=device-width, initial-scale=1'>
  <title>meetcode</title>
</head>
<body>
  <table>
    <tr>
      <th id='hTopic'>Topic</th>
      <th id='hCount'>Count</th>
    </tr>
    <tr>
      <td headers='hTopic'>HTML</td>
      <td headers='hCount'>30</td>
    </tr>
  </table>
</body>
</html>

Official Solution Code

<!doctype html>
<html lang='en'>
<head>
  <meta charset='utf-8'>\
  <meta name='viewport' content='width=device-width, initial-scale=1'>
  <title>meetcode</title>
</head>
<body>
  <table>
    <tr>
      <th id='hTopic'>Topic</th>
      <th id='hCount'>Count</th>
    </tr>
    <tr>
      <td headers='hTopic'>HTML</td>
      <td headers='hCount'>30</td>
    </tr>
  </table>
</body>
</html>
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.