Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's not clear that it is tabular data as some others have commented, though it could be. A table would imply a semantic relationship between all the items in the respective columns (other than just "they're all names of database columns"). Anyway, here's how I've done it before:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt; &lt;head&gt; &lt;title&gt;Form layout&lt;/title&gt; &lt;style type="text/css"&gt; fieldset {width: 60%; margin: 0 auto;} div.row {clear: both;} div.row label {float: left; width: 60%;} div.row span {float: right; width: 35%;} &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;form action="#" method="post"&gt; &lt;fieldset&gt; &lt;legend&gt;Section one&lt;/legend&gt; &lt;div class="row"&gt; &lt;label for="first-field"&gt;The first field&lt;/label&gt; &lt;span&gt;&lt;input type="text" id="first-field" size="15" /&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="row"&gt; &lt;label for="second-field"&gt;The second field with a longer label&lt;/label&gt; &lt;span&gt;&lt;input type="text" id="second-field" size="10" /&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="row"&gt; &lt;label for="third-field"&gt;The third field&lt;/label&gt; &lt;span&gt;&lt;input type="text" id="third-field" size="5" /&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="row"&gt; &lt;input type="submit" value="Go" /&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Edit: Seems that 'by design' I can't reply to comments on my answer, obviously this is somehow less confusing. So, in reply to 17 of 26's comment - the 60% width is entirely optional, by default the fieldset will inherit the width of the containing element. You could also, of course, make use of min-width and max-width, or any of the table layout rules, if only IE supported them, but that's not CSS failing miserably ;)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload