SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot K's Avatar
    Join Date
    Oct 2007
    Posts
    177
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML The best way to align fields in tables?

    Hi i have made some tables with data in,

    and i was wondering the best way/ code i should be using to automatically align them up

    http://murraysofclevedon.co.uk/sardinia.html

    or should i just use <br>'s?


    any help/ links / codes is much appreciated

    thanks K.

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Mods please move to design.

    Don't use <br />s for design alignment - use CSS margins.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Instead of a single row with an unordered list in each column, you should mark this up as a proper table with one row per wine. For example,
    Code HTML4Strict:
    <table>
      <caption>Red Wine</caption>
      <thead>
        <tr>
          <th>Wine</th>
          <th>Size</th>
          <th>£ Unit</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>Grotta Rossa Carignano Del Sulcis 2005 Santadi</td>
          <td>75 cl</td>
          <td>9.90</td>
        </tr>
        <tr>
          <td>Rocca Rubia Carignano Del Sulcis Riserva 2003 Santadi</td>
          <td>75 cl</td>
          <td>18.50</td>
        </tr>
        <tr>
          <td>Terre Brune 2002 Santadi</td>
          <td>75 cl</td>
          <td>40.00</td>
        </tr>
        <tr>
          <td>Montessu Isola Del Nuraghi 2005 Agricola Punica</td>
          <td>75 cl</td>
          <td>30.00</td>
        </tr>
        <tr>
          <td>Barrua 2003 Agricola Punica</td>
          <td>75 cl</td>
          <td>?</td>
        </tr>
      </tbody>
    </table>

    Then use CSS to format the table and the cell contents.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •