Question

I was wondering if using table inside a td (another table inside a table) a good practice or is it a strict no-no, talking in terms of xHTML.

<table>
<tr>
      <td>ABC</td>
      <td>1438</td>
      <td>graph</td>
      <td>holiday</td>

      <td>
        <!--Sub Table -->
        <table>
          <tr>
              <td>Subtable col1</td>
              <td>Subtable col2</td>
          </tr>
        </table>
      </td>
   </tr>
<table>
Was it helpful?

Solution

Semantically speaking if it makes sense for tabular data to be displayed within the cell of another set of tabular data, then it's exactly what you need. Otherwise there is almost always a better solution.

This really isn't an xhtml vs html issue. It's about semantic markup.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top