Skip to content
Write HTML Code · Q8

Q.Write the HTML code to create a two-column table titled "Stationery Price List" with a header row ("Item", "Price") and two data rows: Notebook – 40, Pen – 10.

Maharashtra MsbshseTextbookSubjectiveImportance★★★★★est
75% · 9/12 Questions
✓ Free question

A table is created with the <table> tag. The <caption> gives it a title, each row is a <tr>, header cells (bold, centred) are <th>, and ordinary data cells are <td>. The complete code is:

<table border="1">
  <caption>Stationery Price List</caption>
  <tr>
    <th>Item</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>Notebook</td>
    <td>40</td>
  </tr>
  <tr>
    <td>Pen</td>
    <td>10</td>
  </tr>
</table>

Here the first <tr> holds the two header cells ("Item" and "Price"), and the next two <tr> rows each hold two <td> data cells. The border="1" attribute draws a visible border so the grid can be seen; in a real site the border would normally be styled with CSS instead.

✓Final answer

<table border="1"> <caption>Stationery Price List</caption> <tr> <th>Item</th> <th>Price</th> </tr> <tr> <td>Notebook</td> <td>40</td> </tr> <tr> <td>Pen</td> <td>10</td> </tr> </table> ```

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.