Vertical alignment of label text in F7-grid

going crazy about this. I can’t get it to be vertically aligned in the middle AND the grid cell filled with a different color.

It either looks like this (vertically aligned in the middle but no cell fill):
image

or like this (vertically aligned top but cell fill)):

what am I doing wrong?

- component: f7-row
  config:
    style:
      height: 35px
      align-items: center
  slots:
    default:
      - component: f7-col
        slots:
          default:
            - component: Label
              config:
                text: Test
      - component: f7-col
        config:
          style:
            background: "#222222"
            text-align: center
            align-items: center
        slots:
          default:
            - component: Label
              config:
                text: Test2
                style:
                  height: 35px (adding or deleting this line toggles between the above results)

I think you should set your column height to 100% in the centered case. Looks as if the height was smaller and thus the fill is also smaller.

Unfortunately this does not solve the problem. Result is same to picture 1

Then try this:

    - component: f7-row
      config:
        style:
          height: 35px
          align-items: center
      slots:
        default:
          - component: f7-col
            slots:
              default:
                - component: Label
                  config:
                    text: Test
          - component: f7-col
            config:
              style:
                height: 100%
                background: "#222222"
              class:
                - display-flex
                - justify-content-center
                - align-items-center
            slots:
              default:
                - component: Label
                  config:
                    text: Test2
                    style:
                      color: white
1 Like

thanks. did not work, but when I added

class:
                - display-flex
                - justify-content-center
                - align-items-center

to the Label component it worked. Thanks for the hint

Hmmmm, what I posted did work for me. But anyway, if you solved your problem that’s fine :slightly_smiling_face: