Search code examples
cssresponsive-designhtml-tablesemantic-markup

Nesting tables - legit?


I am creating a restaurant menu, and I'm not sure if I should use tables or not, and especially if I should use nested tables at all. Is this valid? I'm thinking a restaurant menu could be considered tabular data.

Creating the structure with nested tables is incredibly convenient and stable across any browsers, but I don't know if this would be the proper way to do it. Here is what it looks like:

http://jsbin.com/ejoqad/1/edit

  <table>
    <tr>
      <td>
        <table>
          <tr>
            <td>PIZZA</td>
          </tr>
          <tr>
            <td>onions,cheese</td>
          </tr>
        </table>
      </td>
      <td>3.5 $</td>

    </tr>
  </table>

Also, will this structre be likely to cause me troubles down the road when i try to make the design optimised for different devices?


Solution

  • It's certainly valid, but you should probably just use <br /> instead of a whole table just to break a line.