Announcement

Collapse
No announcement yet.

is this when you should use tables?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • is this when you should use tables?

    im creating a restaurant site where ill have a menu page. I was thinkin listing the dishes with a <ul> or <ol> tag but how would i also include the prices to the right of the items? should i just use a 2 col table to accomplish this? im really tryin to stay away from tables by all means necessary but is this the case when i am forced to use them? what do you guys suggest?

  • #2
    You could either float the <li>'s within the <ul>/<ol> tags, or use a definition list in the same way. It'd be less code to do so.

    Tables are fine when they're used for tabular data, and this may qualify if you wanted to go that route anyway.

    Comment


    • #3
      Id definately recommend using tables here. This way, you will ensure that in every size browser, your prices will still be next to the correct item. If you float <div> tags, the overflow of your text could misalign your prices.
      www.jackiecreative.com

      People who live in glass houses sink ships.

      Comment


      • #4
        Originally posted by Patrick Shannon
        You could either float the <li>'s within the <ul>/<ol> tags, or use a definition list in the same way. It'd be less code to do so.

        Tables are fine when they're used for tabular data, and this may qualify if you wanted to go that route anyway.
        just curious how would you accomplish this? floating the li's i understand but how would you do this with 2 elements.

        (ie. name of dish, price of dish)

        Comment


        • #5
          you could do something like:

          <li>name of dish<span>price of dish</span><br /></li>

          and float the name left and the price right, using the break to clear your floats...they'll both stay on the same line that way...until they resize the text enough to make it wrap that is...
          Monarchs Rule!

          Comment


          • #6
            Originally posted by jasonchan
            just curious how would you accomplish this? floating the li's i understand but how would you do this with 2 elements.

            (ie. name of dish, price of dish)
            Well, if it's within a contained area like 300px (just to throw a number out) and you floated two <li>s at 150px (or a little smaller since IE can't get anything right) within, then it should all fall into place.

            But what Jackimalyn just said is correct, if the text goes bigger than the width of the column then that could drastically throw things off. Might just be easier to go with a table, it's not as if you're using it for design or anything.

            Although flutterby's suggeestion isn't bad with some modification. We tend to style our forms like this....

            <ul>
            <li><label>Whatever</label> <span> blah</span></li>
            </ul>

            Then you could use CSS on the various tags to make it do what you want and the <li>s take care of spacing between the elements, etc. Don't even need break tags.

            I would only avoid the table if you can foresee a situation in the future that heavily involves rearranging the way the data is laid out. Otherwise, table away, it's more predictable.
            Last edited by Patrick Shannon; 05-08-2007, 11:17 AM.

            Comment

            Search

            Collapse

            Sponsor

            Collapse

            Incredible Stock

            Latest Topics

            Collapse

            • KitchWitch
              Reply to Portfolio usage of work
              KitchWitch
              If you've looked into fair use and still don't know the answer, I would recommend you speak to a lawyer. If the artist asks you to take their work down, the polite thing to do is take it down. If, however,...
              Today, 12:59 PM
            • B
              Reply to Heyy,
              B
              Those of us who work directly with clients all have the same problem.

              So just a little personal insight from my several decades doing this stuff: clients usually want something different...
              Today, 12:13 PM
            • pers0n
              Portfolio usage of work
              pers0n
              Can someone make you take down something on your portfolio web site?

              I don't claim copyright on them, however I see that there is Copyright Fair Use, which means you are allowed to put things...
              Today, 12:11 PM
            • pers0n
              Reply to Advise please for an Unpaid Internship = Slave
              pers0n
              People will take advantage of you, if you let them. Don't do free work, don't volunteer for any business, unless you are paid on the clock.

              Welcome to the rat race, you have to stick up for...
              Today, 12:06 PM
            • PrintDriver
              Reply to Critique Please?
              PrintDriver
              All of the line weights are the same. I'd do some more thinking about the sound being the same weight as the CF.
              Is it a political lobbying group? or a political action group. I don't normally associate...
              Today, 11:58 AM
            GDF A division of Mediabistro Holdings Adweek | Mediabistro | Clio | Film Expo Group Contact Us | Terms of Use | Privacy Policy Copyright 2016 Mediabistro Holdings
            Working...
            X