Back to Freecodecamp

Step 2

curriculum/challenges/english/blocks/workshop-final-exams-table/66a9b8f14b963916a3baa732.md

latest1.2 KB
Original Source

--description--

To add a caption to a table, you can use the <dfn>table caption</dfn> element.

Here is an example using the caption element:

html
<table>
  <caption>Football Scores</caption>
</table>

Inside your table element, nest a caption element with the text Calculus Final Exam Grades.

--hints--

You should have an opening caption tag.

js
assert.match(code, /<caption>/i);

You should have a closing caption tag.

js
assert.match(code, /<\/caption>/i);

Your caption element should be inside your table element.

js
const captionEl = document.querySelector('caption');
assert.strictEqual(captionEl.parentElement.tagName, 'TABLE');

Your caption should have the text Calculus Final Exam Grades.

js
const captionEl = document.querySelector('caption');
assert.strictEqual(captionEl.innerText.trim(), 'Calculus Final Exam Grades');

--seed--

--seed-contents--

html
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Calculus Final Exams Table</title>
    <meta charset="UTF-8" />
  </head>
  <body>
    <table>
    --fcc-editable-region--
      
    --fcc-editable-region--      
    </table>
  </body>
</html>