1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

width = 80% if width<1000px else width=1000px

Discussion in 'HTML & Website Design' started by david_sakh, Oct 25, 2004.

  1. #1
    how is this done? :(
     
    david_sakh, Oct 25, 2004 IP
  2. TwisterMc

    TwisterMc Mac Guru

    Messages:
    972
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    1st you'd have to use javascript to detect the visitors window size
    2nd you'd have to do an if/else statement to determine if you were going to use 80% or 1000px.
    3rd You'd have to put that variable into your HTML.

    How's that?
     
    TwisterMc, Oct 25, 2004 IP
  3. NewComputer

    NewComputer Well-Known Member

    Messages:
    2,021
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    188
    #3
    Bang on and almost a total waste of time and effort to do it....
     
    NewComputer, Oct 25, 2004 IP
  4. mopacfan

    mopacfan Peon

    Messages:
    3,273
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #4
    With asp, you can get the screen size and do the calculations server side. What language are you using?
     
    mopacfan, Oct 25, 2004 IP
  5. david_sakh

    david_sakh Peon

    Messages:
    1,225
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #5
    some short paragraphs just look really stupid stretched out to 2000 px :(

    I guess I could google all of that. Thanks for steering me in the right direction.
     
    david_sakh, Oct 25, 2004 IP
  6. Foxy

    Foxy Chief Natural Foodie

    Messages:
    1,614
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Why 2000px?

    Most systems out there are way short of that so hard limit your page to eg 730 - most do :)
     
    Foxy, Oct 25, 2004 IP
  7. TwisterMc

    TwisterMc Mac Guru

    Messages:
    972
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Right direction is what I was going for. I don't know all the code. :D
     
    TwisterMc, Oct 25, 2004 IP
  8. Sham

    Sham Peon

    Messages:
    136
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I've often wanted to do this.

    Basically, having an upper limit on the width of a table.

    I don't know why this isn't an existing property of the table tag, since it would come in so handy at times.
     
    Sham, Jan 27, 2006 IP
  9. Sham

    Sham Peon

    Messages:
    136
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Oh actually, there's apprently a CSS max-width property that you might wanna experiement with. For example:

    <table width="80%" and style="max-width:1000px">
    <tr><td>&nbsp;</td></tr>
    </table>
     
    Sham, Jan 27, 2006 IP
  10. Sham

    Sham Peon

    Messages:
    136
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    If that doesnt work (I cant test this at the mo..), then enclose your table inside a div:

    <div style="width:80%;max-width:1000px">
    <table width="100%"><tr><td>&nbsp;</td></tr>
    </table>
    </div>
     
    Sham, Jan 27, 2006 IP
  11. Sham

    Sham Peon

    Messages:
    136
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Oh sorry, I didn't realise this thread was over a year old!
     
    Sham, Jan 27, 2006 IP
  12. david_sakh

    david_sakh Peon

    Messages:
    1,225
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #12
    no problem. perhaps this will help someone else. :)
     
    david_sakh, Feb 2, 2006 IP