views:

33

answers:

1

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>
+3  A: 

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.

Matthew Vines
Well I saw this code and I think it can be achieved by using <ol> but the person had done it by using another table.
AJ
If a list works, I would personally prefer that to a nested table.
Matthew Vines