How to avoid distributing rows evenly vertically in a table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • michanek
    New Member
    • Sep 2013
    • 4

    How to avoid distributing rows evenly vertically in a table

    I have a table with a spanned row looking like this:
    +----------+---------+
    | Spanned | Row A |
    | row | |
    | (several +---------+
    | lines of | Row B |
    | text) | |
    +----------+---------+
    The contents of Row A and B are vertically top-aligned, but the Rows are also distributed evenly vertically to have the same height as the spanned row.
    I want the result ot be like this instread:
    +----------+---------+
    | Spanned | Row A |
    | row +---------+
    | (several | Row B |
    | lines of | |
    | text) | |
    +----------+---------+
    That is, I want Row A to be as small as possible and only Row B to expand vertically. Can this be done? I have tried various styling through CSS, including min-height, but the rows always seem to be distributed evenly.
    In reality, I have more rows than A and B, and I want only the last one to expand vertically beyond the actual contents. I cannot predict the actual amount of content in any of the rows, so explicitly setting the height won't work.
  • michanek
    New Member
    • Sep 2013
    • 4

    #2
    Sorry, the tables should look like this:
    Code:
    +----------+---------+
    | Spanned  |  Row A  |
    | row      |         |
    | (several +---------+
    | lines of |  Row B  |
    | text)    |         |
    +----------+---------+
    Code:
    +----------+---------+
    | Spanned  |  Row A  |
    | row      +---------+
    | (several |  Row B  |
    | lines of |         |
    | text)    |         |
    +----------+---------+

    Comment

    • ariful alam
      New Member
      • Jan 2011
      • 185

      #3
      Hello,
      Do you need 1st column (single row) = 2nd column (two row)?

      with regards
      Ariful Alam

      Comment

      • michanek
        New Member
        • Sep 2013
        • 4

        #4
        I'm not sure I understand your question. If you mean column widths, the 1st column will have a fixed width, but the 2nd column doesn't need to be. However, I feel that column widths shouldn't affect the question?

        Comment

        • Rabbit
          Recognized Expert MVP
          • Jan 2007
          • 12517

          #5
          Can't you give Row A a fixed height?

          Comment

          • michanek
            New Member
            • Sep 2013
            • 4

            #6
            No, because the content of Row A will vary. The point is that no row except the last should be higher than needed.
            I will probably find another layout for this.

            Comment

            • Rabbit
              Recognized Expert MVP
              • Jan 2007
              • 12517

              #7
              Rather than a table for layout, have you tried divs instead?

              Comment

              Working...