SitePoint Sponsor

User Tag List

Results 1 to 19 of 19
  1. #1
    Free me php klassicd's Avatar
    Join Date
    Sep 2001
    Location
    San Diego
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Percentage to Pixels

    I happen to make all the tables in my site % rather than pixels. But when someone changes the size of the browser it really makes it look ugly. Is there a quick way to change all my % to pixels? I heard frontpage could but thats a rumor.

  2. #2
    SitePoint Addict
    Join Date
    Mar 2001
    Posts
    379
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use percentage for the most part so that the page will look fine on all browser sizes. For example, if a page is created in pixels, a visitor with a lower resolution won't get scroll bars.

    That's just me thought, what about everyone else?

  3. #3
    SitePoint Member
    Join Date
    Feb 2002
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in html percentages are written like 100% and pixels are just 780 NUMBERS. It depends on your layout. If you want to set your site so it stays at one size use 780 in ur tables, its for a 800x600 resolution. if u want it to fit for every resolution use 100% width so it will take up all the space.

  4. #4
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sites that have the main table set to 780 pixles will side scroll on 800x600 if you do not set the left and right margins to 0, 750 pixels is a much safer bet.
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.

  5. #5
    SitePoint Member
    Join Date
    Feb 2002
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i use the body tag <!body topmargin=0 leftmargin=0>

  6. #6
    SitePoint Addict Scud's Avatar
    Join Date
    Jan 2002
    Location
    Los Angeles
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, you could also contain the whole page in a maximum sized table.. like say use a 600pixel width table and have all the content within that. Then you need not worry about higher resolutions messing up your design.

    Just a thought.

  7. #7
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    klassicd...

    TO answer your question, there's no easy wat to change your percentage widths to pixel widths. The best way is to do it by hand. Unless you've got tons of TABLEs it shouldn't take you more than a few minutes.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  8. #8
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by RaYoVaC
    i use the body tag <!body topmargin=0 leftmargin=0>
    You do mean <body topmargin=0 leftmargin=0>, don't you?

    -Colin
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  9. #9
    SitePoint Wizard iTec's Avatar
    Join Date
    May 2001
    Location
    Sydney, Australia
    Posts
    2,243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you have dreamweaver there is a button on the properties menu that will convert beetween % and pixel and vice versa,

  10. #10
    Don't get too close, I bite! Nicky's Avatar
    Join Date
    Jul 1999
    Location
    Lancashire, UK
    Posts
    8,277
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by iTec
    If you have dreamweaver there is a button on the properties menu that will convert beetween % and pixel and vice versa,
    ...and I could write a book on why that is not a good idea.

  11. #11
    1-800-JMULDER JMulder's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,745
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a tip, it depends on how the page was designed though. But you could make a table around your complete site and set that one to a fixed width.

    As I said, it depends on how it is designed but it usually works pretty fine with most of the design. And a plus is, you won't need to start calculating the pixels, you just leave the %'s as they were used to be
    Jeroen Mulder

    w: www.jeroenmulder.com

  12. #12
    SitePoint Enthusiast steviray's Avatar
    Join Date
    Dec 2001
    Location
    Mississippi
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Perfect Topic

    Let's say that someone uses FP! (Not me )

    For Example:

    ~ on a blank page, you create a single table (setting the properties of that table to 100% width.)

    ~ from their you can add tables as needed to place your objects/content into (manipulating these inner tables to reside as your design calls for... i.e. setting properties to suit the needed layout)

    Do I understand the above comment to say that this type of page layout will give you a site that will maintain the intended look of the site across all possible monitor settings that may be used?
    (either shrink or enlarge as needed)

    Thanks

    Steve

  13. #13
    1-800-JMULDER JMulder's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,745
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you talking about my comment?

    Well, using tables with a fixed width will prevent your tables from stretching, so I think the answer to your question would be yes if your outer table has a fixed width.
    Jeroen Mulder

    w: www.jeroenmulder.com

  14. #14
    SitePoint Enthusiast steviray's Avatar
    Join Date
    Dec 2001
    Location
    Mississippi
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for clearing this up for me JMulder.



    Yeah... was referring to your post, indeed!

    Steve

  15. #15
    SitePoint Enthusiast slp's Avatar
    Join Date
    May 2001
    Location
    Australia
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I think the decision to use % or pixels depends on the specific situation. I use % in some cases and pix in other, depending on whether I mind things getting stretched out, and that sort of thing.

    As for easily converting between the two, that sounded like a fun & easy javascript challenge to me. So if you're not fond of using calculators, have a look at the form I made at http://astroguitar.cjb.net/perpix.htm and convert away!
    Hours of fun for the whole family

  16. #16
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow...

    Great resource.

    Hey...where did you get those images of space? Do you have them in a higher res? I'd love to get that image of Jupiter large enough for a desktop.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  17. #17
    SitePoint Enthusiast slp's Avatar
    Join Date
    May 2001
    Location
    Australia
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. It's amazing what I'll do when I'm in the mood to write javascript. Hopefully somebody out there will find some use for it.

  18. #18
    SitePoint Guru
    Join Date
    Aug 2001
    Location
    Amsterdam
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Nicky

    ...and I could write a book on why that is not a good idea.
    If you ever need an extra set of chapters I'm game


    BTW good script SLP !!!!!!!!!
    Last edited by peanuts; Feb 6, 2002 at 07:56.
    the neigbours (free) WIFI makes it just a little more fun

  19. #19
    Free me php klassicd's Avatar
    Join Date
    Sep 2001
    Location
    San Diego
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks for all the suggestions

    Easiest wasy i found was find and replace in notepad. What a great program.

    I had alot of trouble using % especially with images seeing the way mac's convert the pages. Ill stick with Perc.


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
  •