7 Replies Latest reply on Nov 15, 2006 6:45 AM by Newsgroup_User

    css floats

    m0piqsutjjqv4du
      I would like to create a "floating table" (for lack of a better description)

      Where as There would be a block element say <p id="thisblock">This block would have some text, images, all formatted and wrapped in a border - thanks to #thisblock {...} in css</p>

      now in that box, i would like to put a list that would split down 2 columns, left one will be aligned right, right aligned left ie:

      This block would have some text, images, all formatted and wrapped in a border
      ________XXXXXXXXXXXXXXXX_____XXXXXXXXXXXXXXXXXXXXX
      __ XXXXXXXXXXXXXXXXXXXXXX____XXXXXXXXXXXXXXXXXXXXXXXX
      _________ XXXXXXXXXXXXXXX____XXXXXXXXXXXXXXXXXXXXXXX
      then some more text down here

      well you get the idea. I tried using floats, but of course the "then some more text" ends up buried under the list. I tried clear: both, but that didn't help. im new to css and any help would be appreciated!

      Thanks
        • 1. Re: css floats
          Level 7
          Why not use a table within the floating element?

          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.dreamweavermx-templates.com - Template Triage!
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
          ==================


          "m0piqsutjjqv4du" <webforumsuser@macromedia.com> wrote in message
          news:ejakns$338$1@forums.macromedia.com...
          >I would like to create a "floating table" (for lack of a better
          >description)
          >
          > Where as There would be a block element say <p id="thisblock">This block
          > would
          > have some text, images, all formatted and wrapped in a border - thanks to
          > #thisblock {...} in css</p>
          >
          > now in that box, i would like to put a list that would split down 2
          > columns,
          > left one will be aligned right, right aligned left ie:
          >
          > This block would have some text, images, all formatted and wrapped in a
          > border
          > ________XXXXXXXXXXXXXXXX_____XXXXXXXXXXXXXXXXXXXXX
          > __ XXXXXXXXXXXXXXXXXXXXXX____XXXXXXXXXXXXXXXXXXXXXXXX
          > _________ XXXXXXXXXXXXXXX____XXXXXXXXXXXXXXXXXXXXXXX
          > then some more text down here
          >
          > well you get the idea. I tried using floats, but of course the "then some
          > more
          > text" ends up buried under the list. I tried clear: both, but that didn't
          > help.
          > im new to css and any help would be appreciated!
          >
          > Thanks
          >


          • 2. Re: css floats
            m0piqsutjjqv4du Level 1
            ahh yes...
            Simplicity!
            I guess in my attempt to steer away from tables in design, it's also important to consider that if you need a table in content - use a table!
            Ha Ha - Thanks Murray!
            • 3. Re: css floats
              Level 7
              You're welcome!

              --
              Murray --- ICQ 71997575
              Adobe Community Expert
              (If you *MUST* email me, don't LAUGH when you do so!)
              ==================
              http://www.dreamweavermx-templates.com - Template Triage!
              http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
              http://www.dwfaq.com - DW FAQs, Tutorials & Resources
              http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
              ==================


              "m0piqsutjjqv4du" <webforumsuser@macromedia.com> wrote in message
              news:ejch27$b3p$1@forums.macromedia.com...
              > ahh yes...
              > Simplicity!
              > I guess in my attempt to steer away from tables in design, it's also
              > important to consider that if you need a table in content - use a table!
              > Ha Ha - Thanks Murray!


              • 4. Re: css floats
                m0piqsutjjqv4du Level 1
                is there an efficient way to format this table, rather than setting align and width values to each individual table cell? it just seems like an awful lot of redundant code...
                • 5. Re: css floats
                  Level 7
                  td {
                  text-align:left;
                  }

                  Or whatever. :)
                  Widths you only need to set on the first row and the rest will follow.


                  "m0piqsutjjqv4du" <webforumsuser@macromedia.com> wrote in message
                  news:ejcm2j$gsq$1@forums.macromedia.com...
                  > is there an efficient way to format this table, rather than setting align
                  > and width values to each individual table cell? it just seems like an
                  > awful lot of redundant code...


                  • 6. Re: css floats
                    m0piqsutjjqv4du Level 1
                    yes, but this table would need 1/2 the cells (left column) align:right, and the right aligned left. I think i'm gonna use two different tables, it should produce the desired effect....
                    • 7. Re: css floats
                      Level 7
                      Either way. You'd have to pick a default alignment, then use a class in
                      order to use CSS for that. Or depending on your page structure, maybe some
                      special selectors. If you have different tables, each can have an ID.

                      #leftTable td {
                      text-align:left;
                      }

                      #rightTable td {
                      text-align:right;
                      }

                      That kind of thing.
                      It should end up with a lot less code on the page than having
                      align="something" on every cell. ;)


                      "m0piqsutjjqv4du" <webforumsuser@macromedia.com> wrote in message
                      news:eje2tv$95s$1@forums.macromedia.com...
                      > yes, but this table would need 1/2 the cells (left column) align:right,
                      > and the right aligned left. I think i'm gonna use two different tables, it
                      > should produce the desired effect....