Table within a <div>

Discussion in 'HTML' started by Paul Watt, Apr 10, 2006.

  1. Paul Watt

    Paul Watt Guest

    Hi,

    i've placed a table within a <div> to dispay some data.
    All is well in FF, but in MSIE the table starts inline with the bottom of
    the <div> to the left. I've set the css div to vertical align: top, but this
    hasn't made a differance.

    http://www.paulwatt.info/test/calendar.htm

    Thanks guys


    --

    Paul Watt
    http://www.paulwatt.info
     
    Paul Watt, Apr 10, 2006
    #1
    1. Advertising

  2. Paul Watt

    Guest

    Joined:
    Feb 4, 2010
    Messages:
    13
    Have you tried experimenting with CSS "margin" and "padding" also?

    As these aren't always treated consistently across browsers.
     
    Guest, Apr 10, 2006
    #2
    1. Advertising

  3. Paul Watt

    Paul Watt Guest

    <> wrote in message
    news:...
    >
    > Have you tried experimenting with CSS "margin" and "padding" also?
    >
    > As these aren't always treated consistently across browsers.
    >


    Sorted now, thanks. used negetive margins and the underscore hack in the
    end.
     
    Paul Watt, Apr 10, 2006
    #3
  4. Paul Watt

    kchayka Guest

    Paul Watt wrote:
    >
    > used negetive margins and the underscore hack in the end.


    Sounds very much like you are treating the symptoms, not the problem.
    That is surely the wrong way to go about it.

    --
    Reply email address is a bottomless spam bucket.
    Please reply to the group so everyone can share.
     
    kchayka, Apr 10, 2006
    #4
  5. Paul Watt

    Paul Watt Guest

    "kchayka" <> wrote in message
    news:...
    > Paul Watt wrote:
    >>
    >> used negetive margins and the underscore hack in the end.

    >
    > Sounds very much like you are treating the symptoms, not the problem.
    > That is surely the wrong way to go about it.
    >


    What would you suggest?
     
    Paul Watt, Apr 10, 2006
    #5
  6. Paul Watt

    John Bokma Guest

    "Paul Watt" <> wrote:

    >
    > "kchayka" <> wrote in message
    > news:...
    >> Paul Watt wrote:
    >>>
    >>> used negetive margins and the underscore hack in the end.

    >>
    >> Sounds very much like you are treating the symptoms, not the problem.
    >> That is surely the wrong way to go about it.
    >>

    >
    > What would you suggest?


    If it's an IE only issue (make sure that it really is) then you don't use
    hacks, you use "conditional comments":

    <http://virtuelvis.com/archives/2004/02/css-ie-only>

    Hacks are ugly.

    --
    John

    Net::Google and Perl: http://johnbokma.com/perl/net-google.html
     
    John Bokma, Apr 10, 2006
    #6
  7. Paul Watt

    Jim Moe Guest

    Paul Watt wrote:
    >
    > i've placed a table within a <div> to dispay some data.
    > All is well in FF, but in MSIE the table starts inline with the bottom of
    > the <div> to the left. I've set the css div to vertical align: top, but this
    > hasn't made a differance.
    >
    > http://www.paulwatt.info/test/calendar.htm
    >

    IE does not always correctly flow blocks. I'm a little vague on the
    specifics but IIRC it miscalculates the available horizontal space
    thinking there is not enough for, say, a table whose width is 100%.
    A couple of things to try:
    1. Float the .content div
    2. Set the table's width to less than 100%, or do not use a width at all

    BTW "vertical-align: top" is meaningless for a div.

    --
    jmm (hyphen) list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)
     
    Jim Moe, Apr 10, 2006
    #7
  8. Paul Watt

    dorayme Guest

    In article <Xns97A19213950B0castleamber@130.133.1.4>,
    John Bokma <> wrote:

    > If it's an IE only issue (make sure that it really is) then you don't use
    > hacks, you use "conditional comments":
    >
    > <http://virtuelvis.com/archives/2004/02/css-ie-only>
    >
    > Hacks are ugly.


    Well, maybe it is a matter of taste... on reflection, are hacks
    per se ugly, and does it matter? What matters objectively is that
    something relatively simple works, that it is not going to be a
    nuisance later. This latter possibility is a serious one.

    Ugly is in the eye of the beholder on this one, I don't find them
    that ugly, they have been cleverly found and work and I am
    reminded of this when I see them and I look on admiringly. They
    are simpler in many ways than making separate style sheets just
    for this IE or that IE and IE in common.

    I am not advocating them here. I just think it is a bit precious
    to refrain from fighting something ugly (IE rendering standards)
    in too prim and proper a manner. There is an argument here that
    the remedy rather nicely fits the cause.

    And really, when push comes to shove, they are broadly
    conditional defences against specific nuisances.

    --
    dorayme
     
    dorayme, Apr 10, 2006
    #8
  9. Paul Watt

    John Bokma Guest

    dorayme <> wrote:

    > In article <Xns97A19213950B0castleamber@130.133.1.4>,
    > John Bokma <> wrote:


    [..]

    >> Hacks are ugly.

    >
    > Well, maybe it is a matter of taste...


    No it isn't. If you can do the same thing with a conditional comment, do
    it with a conditional comment.

    --
    John Experienced (web) developer: http://castleamber.com/

    Textpad quick reference card (pdf): http://johnbokma.com/textpad/
     
    John Bokma, Apr 10, 2006
    #9
  10. Paul Watt

    dorayme Guest

    In article <Xns97A1B20EE9C4Bcastleamber@130.133.1.4>,
    John Bokma <> wrote:

    > dorayme <> wrote:
    >
    > > In article <Xns97A19213950B0castleamber@130.133.1.4>,
    > > John Bokma <> wrote:

    >
    > [..]
    >
    > >> Hacks are ugly.

    > >
    > > Well, maybe it is a matter of taste...

    >
    > No it isn't.


    Yes it is.

    --
    dorayme
     
    dorayme, Apr 10, 2006
    #10
  11. Paul Watt

    GreyWyvern Guest

    And lo, John Bokma didst speak in
    alt.html,alt.www.webmaster,comp.infosystems.www.authoring.stylesheets:

    > dorayme wrote:
    >
    >> John Bokma wrote:

    >
    > [..]
    >
    >>> Hacks are ugly.

    >>
    >> Well, maybe it is a matter of taste...

    >
    > No it isn't. If you can do the same thing with a conditional comment, do
    > it with a conditional comment.


    IIRC, IE/Mac does not support IE conditional comments. If you are
    comfortable with excluding that (small and shrinking) market share, then
    yesh, conditional comments are preferable to IE hacks.

    Grey

    --
    The technical axiom that nothing is impossible sinisterly implies the
    pitfall corollary that nothing is ridiculous.
    - http://www.greywyvern.com/orca#search - Orca Search - PHP/MySQL site
    search engine
     
    GreyWyvern, Apr 11, 2006
    #11
  12. Paul Watt

    Ian Collins Guest

    GreyWyvern wrote:
    > And lo, John Bokma didst speak in
    > alt.html,alt.www.webmaster,comp.infosystems.www.authoring.stylesheets:
    >
    >> dorayme wrote:
    >>
    >>> John Bokma wrote:

    >>
    >>
    >> [..]
    >>
    >>>> Hacks are ugly.
    >>>
    >>>
    >>> Well, maybe it is a matter of taste...

    >>
    >>
    >> No it isn't. If you can do the same thing with a conditional comment, do
    >> it with a conditional comment.

    >
    >
    > IIRC, IE/Mac does not support IE conditional comments. If you are
    > comfortable with excluding that (small and shrinking) market share,
    > then yesh, conditional comments are preferable to IE hacks.
    >

    It (IE/Mac) doesn't suffer the same CSS bugs as IE/windows, does it? So
    the lack of conditional comment support might be a good thing in this case.

    --
    Ian Collins.
     
    Ian Collins, Apr 11, 2006
    #12
  13. Paul Watt

    trippy Guest

    In article <>, Paul Watt took the
    hamburger, threw it on the grill, and I said "Oh wow"...

    > Hi,
    >
    > i've placed a table within a <div> to dispay some data.
    > All is well in FF, but in MSIE the table starts inline with the bottom of
    > the <div> to the left. I've set the css div to vertical align: top, but this
    > hasn't made a differance.



    vertical-align:top

    You need the dash in there.

    >
    > http://www.paulwatt.info/test/calendar.htm
    >
    > Thanks guys
    >
    >
    >


    --
    trippy
    mhm31x9 Smeeter#29 WSD#30
    sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM

    NP: "Rhythm From A Red Car" -- Hardline

    "Now, technology's getting better all the time and that's fine,
    but most of the time all you need is a stick of gum, a pocketknife,
    and a smile."

    -- Robert Redford "Spy Game"
     
    trippy, Apr 11, 2006
    #13
  14. Paul Watt

    Jim Moe Guest

    Jim Moe wrote:
    > A couple of things to try:
    > 1. Float the .content div
    > 2. Set the table's width to less than 100%, or do not use a width at all
    >

    I decided to look at this more closely.
    Change the table's width to 99%.

    --
    jmm (hyphen) list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)
     
    Jim Moe, Apr 11, 2006
    #14
  15. Paul Watt

    Toby Inkster Guest

    John Bokma wrote:
    > dorayme wrote:
    >> John Bokma <> wrote:
    >>
    >>> Hacks are ugly.

    >>
    >> Well, maybe it is a matter of taste...

    >
    > No it isn't. If you can do the same thing with a conditional comment, do
    > it with a conditional comment.


    Conditional comments *are* a hack. They're more reliable than many other
    hacks, but hacks all the same.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Apr 11, 2006
    #15
  16. Paul Watt

    Neredbojias Guest

    To further the education of mankind, Toby Inkster
    <> declaimed:

    > John Bokma wrote:
    >> dorayme wrote:
    >>> John Bokma <> wrote:
    >>>
    >>>> Hacks are ugly.
    >>>
    >>> Well, maybe it is a matter of taste...

    >>
    >> No it isn't. If you can do the same thing with a conditional comment,
    >> do it with a conditional comment.

    >
    > Conditional comments *are* a hack. They're more reliable than many
    > other hacks, but hacks all the same.


    One could say they're a heck of a hack...

    --
    Neredbojias
    Infinity can have limits.
     
    Neredbojias, Apr 11, 2006
    #16
  17. Paul Watt

    John Bokma Guest

    Toby Inkster <> wrote:

    > John Bokma wrote:
    >> dorayme wrote:
    >>> John Bokma <> wrote:
    >>>
    >>>> Hacks are ugly.
    >>>
    >>> Well, maybe it is a matter of taste...

    >>
    >> No it isn't. If you can do the same thing with a conditional comment,
    >> do it with a conditional comment.

    >
    > Conditional comments *are* a hack.


    Yeah, sure Toby, whatever you call it.

    --
    John Freelance Perl programmer: http://castleamber.com/

    Installing and configuring Apache on Windows XP (virtual hosting):
    http://johnbokma.com/windows/apache-virtual-hosts-xp.html
     
    John Bokma, Apr 11, 2006
    #17
  18. Paul Watt

    kchayka Guest

    John Bokma wrote:
    > "Paul Watt" <> wrote:
    >
    >> "kchayka" <> wrote in message
    >> news:...
    >>>
    >>> Sounds very much like you are treating the symptoms, not the problem.
    >>> That is surely the wrong way to go about it.

    >>
    >> What would you suggest?

    >
    > If it's an IE only issue (make sure that it really is) then you don't use
    > hacks, you use "conditional comments":


    I wouldn't leave it to this particular OP to determine it really is an
    IE only issue. He isn't adept enough at CSS to know. Given time, maybe.

    Looking at his test page <http://www.paulwatt.info/test/calendar.htm>
    I'd say he is definitely going about it wrong.

    > Hacks are ugly.


    As someone else pointed out, conditional comments are indeed a hack, but
    cluttering up the HTML instead of the CSS. Personally, I'd rather have
    that kind of clutter in one CSS file instead of embedded on every page.

    BTW, since IE7 does sooooooo much better at CSS than IE6 does, I have
    found the *html hack to be most excellent. IE7 ignores it, and applies
    the standard CSS rules other browsers get. Beautiful. :)

    --
    Reply email address is a bottomless spam bucket.
    Please reply to the group so everyone can share.
     
    kchayka, Apr 11, 2006
    #18
  19. Paul Watt

    kchayka Guest

    Jim Moe wrote:
    > Jim Moe wrote:
    >> A couple of things to try:
    >> 2. Set the table's width to less than 100%, or do not use a width at all
    >>

    > I decided to look at this more closely.
    > Change the table's width to 99%.


    Better is to set no width at all, methinks. He set a 10px left margin on
    the table. When added to 99%, it comes out to something more or less
    than 100%. I get a horizontal scrollbar with IE.

    --
    Reply email address is a bottomless spam bucket.
    Please reply to the group so everyone can share.
     
    kchayka, Apr 11, 2006
    #19
  20. On Tue, 11 Apr 2006, kchayka wrote:

    > BTW, since IE7 does sooooooo much better at CSS than IE6 does, I
    > have found the *html hack to be most excellent. IE7 ignores it, and
    > applies the standard CSS rules other browsers get. Beautiful. :)


    I seem to recall reading somewhere that we were urged to show no mercy
    to IE7, but to treat it as if it were a real WWW browser. If that's
    the official policy, I'm only too happy to stick to it ;-)

    [yes, I know it still has lots of non-standard features, including
    some cases where it violates mandatory requirements of the relevant
    specifications. But if we're supposed to treat it like a WWW browser,
    so be it. Or perhaps that was only the beta? ]
     
    Alan J. Flavell, Apr 11, 2006
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Noozer

    Block DIV within a block DIV?

    Noozer, Jan 6, 2005, in forum: HTML
    Replies:
    3
    Views:
    11,415
    Mitja
    Jan 6, 2005
  2. Tom

    div within div

    Tom, Jan 14, 2005, in forum: HTML
    Replies:
    10
    Views:
    1,004
    Andy Dingley
    Jan 15, 2005
  3. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    788
  4. Dwayne Madsen

    Q: Div A inside Div B is larger than Div B

    Dwayne Madsen, Jun 1, 2005, in forum: Javascript
    Replies:
    1
    Views:
    219
    David Dorward
    Jun 1, 2005
  5. mscir
    Replies:
    3
    Views:
    343
    Martin Honnen
    Jun 26, 2005
Loading...

Share This Page