title: Control layout of text input and checkboxes within a table cell
body: <p>I have some HTML that displays a text input and 2 checkboxes side by side.  The HTML is generated by a tool and so I cannot alter the way the HTML is built, I can only apply styling to it using CSS.  My simplified HTML and CSS is:</p>
  <pre><code>&lt;html&gt;
   &lt;head&gt;
    &lt;style type=&quot;text/css&quot;&gt;
    td {
      padding: 0;
      }
    fieldset {
      display: inline;
      padding: 0;
      margin: 0
      }
    input[type=&quot;text&quot;] {
      margin: 0;
      padding: 0;
      }
    table.checkboxs  {
      border-collapse:collapse;
      }
    table.checkboxs td {
      border: none;
      margin: 0;
      padding: 0;
    }
   &lt;/style&gt;
   &lt;/head&gt;
   &lt;body&gt;
       &lt;input type=&quot;text&quot; id=&quot;item1&quot; value=&quot;&quot; /&gt;
       &lt;fieldset&gt;
        &lt;table summary=&quot;&quot; class=&quot;checkboxs&quot; border-collapse=&quot;&quot;&gt;
         &lt;tr&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; id=&quot;chkbox_0&quot; name=&quot;chkbox&quot; value=&quot;1&quot;   /&gt;&lt;label for=&quot;chkbox_0&quot;&gt;One&lt;/label&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type=&quot;checkbox&quot; id=&quot;chkbox_1&quot; name=&quot;chkbox&quot; value=&quot;2&quot;   /&gt;&lt;label for=&quot;chkbox_1&quot;&gt;Two&lt;/label&gt;&lt;/td&gt;
         &lt;/tr&gt;
        &lt;/table&gt;
       &lt;/fieldset&gt;
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>This ends up with the checkboxes displayed higher up than the text item like this:</p>
  <p><img src="https://i.stack.imgur.com/jquva.png" alt="Screenshot 1" /></p>
  <p>What I would like is them aligned together like this:</p>
  <p><img src="https://i.stack.imgur.com/5pLhk.png" alt="Screenshot 2" /></p>
  <p>That seems simple enough, but I cannot figure out how to achieve it.  If you remove either the text input or the fieldset then the remaining element takes up the minimum vertical space, it is only when they are together that the text input gets pushed down the page.</p>
  <p>By all means point out any shortcomings in the HTML, but as I said that is really not under my control, I can only influence the layout using CSS.</p>