Open spaces between cards in Dwains Dasboard

Hi there,

Im building a dashboard based on Dwains dashboard. The dashboard should fit on a 10 inch tablet without the need for scrolling. Now, I bassicly got all the cards I need on the home page but there is blank spacing between cards that I want to get rid of. I dont have the options tomove the cards around (I think because they are all Lovelace cards). Does anybody know how to get rid of these empty spaces. In the picture is a clear exanple where I want to calander cards to move up until the waste disposal card.

Re arranging the cards would also help but not 100%. But I could figure out how the auto arraging works…

You need an integration called Card Mod.

This integration allows you to alter the CSS settings, so borders, colors, margins and so on can be changed to your liking.

You might want to use the forum post for better explanations here.

Especially the link in the bottom of the first post to " FANTASTIC POST BY ILDAR GABDULLIN ON HOW TO MODIFY EVERYTHING WITH CARD-MOD" is a good post for explanations and the " How to manage a row’s height" might be one way to solve your problem.

1 Like

Hi, thanks for your answer however Im not sure if this will do the trick. Im bassicly talking about 2 seperatd cards that have spacing between them. The card which states 5 - 11 jan. 2023 needs to move upwards to the card which states PMD, Dinsdag (over 12 dagen)

It should still be possible.
It is the borders you need to modify.
I will post my modifications later when I get home.
I have some cards in a horizontal and vertical stack that I have moved closer together that way.

Hi, we are talking about 2 seperate cards here. First card (top right) is

type: custom:auto-entities
card:
  title: Volgende ophaaldata afval
  type: entities
col_span: '2'
col_span_lg: '1'
col_span_xl: '2'
filter:
  include:
  - entity_id: sensor.afvalwijzer_pmd_next
    options:
      secondary: "{% set count = states(config.entity)|int %} {% set day = state_attr(config.entity,'day')\
        \ %} {% set dagen =\n  {'Monday': 'Maandag',\n  'Tuesday': 'Dinsdag',\n  'Wednesday':\
        \ 'Woensdag',\n  'Thursday': 'Donderdag',\n  'Friday': 'Vrijdag',\n  'Saturday':\
        \ 'Zaterdag',\n  'Sunday': 'Zondag'} %}\n{% set dag = dagen[day] if day in\
        \ dagen else day %} {% set unit = 'Dag' if count == 1 else 'dagen' %}\n\n\
        {% if count < 30 %} {% set phrase = dag%}{% endif %} {{phrase}} {% if count\
        \ != 0%} (over {{count}} {{unit}}) {% endif %}\n"
      state: '{{state_attr(config.entity,''date'')}}

        '
      type: custom:template-entity-row
  - entity_id: sensor.afvalwijzer_gft_next
    options:
      secondary: "{% set count = states(config.entity)|int %} {% set day = state_attr(config.entity,'day')\
        \ %} {% set dagen =\n  {'Monday': 'Maandag',\n  'Tuesday': 'Dinsdag',\n  'Wednesday':\
        \ 'Woensdag',\n  'Thursday': 'Donderdag',\n  'Friday': 'Vrijdag',\n  'Saturday':\
        \ 'Zaterdag',\n  'Sunday': 'Zondag'} %}\n{% set dag = dagen[day] if day in\
        \ dagen else day %} {% set unit = 'Dag' if count == 1 else 'dagen' %}\n{%\
        \ if count < 30 %} {% set phrase = dag%}{% endif %} {{phrase}} {% if count\
        \ != 0%} (over {{count}} {{unit}}) {% endif %}\n"
      state: '{{state_attr(config.entity,''date'')}}

        '
      type: custom:template-entity-row
  - entity_id: sensor.afvalwijzer_papier_next
    options:
      secondary: "{% set count = states(config.entity)|int %} {% set day = state_attr(config.entity,'day')\
        \ %} {% set dagen =\n  {'Monday': 'Maandag',\n  'Tuesday': 'Dinsdag',\n  'Wednesday':\
        \ 'Woensdag',\n  'Thursday': 'Donderdag',\n  'Friday': 'Vrijdag',\n  'Saturday':\
        \ 'Zaterdag',\n  'Sunday': 'Zondag'} %}\n{% set dag = dagen[day] if day in\
        \ dagen else day %} {% set unit = 'Dag' if count == 1 else 'dagen' %}\n\n\
        {% if count < 30 %} {% set phrase = dag%}{% endif %} {{phrase}} {% if count\
        \ != 0%} (over {{count}} {{unit}}) {% endif %}\n"
      state: '{{state_attr(config.entity,''date'')}}

        '
      type: custom:template-entity-row
  - entity_id: sensor.afvalwijzer_restafval_next
    options:
      secondary: "{% set count = states(config.entity)|int %} {% set day = state_attr(config.entity,'day')\
        \ %} {% set dagen =\n  {'Monday': 'Maandag',\n  'Tuesday': 'Dinsdag',\n  'Wednesday':\
        \ 'Woensdag',\n  'Thursday': 'Donderdag',\n  'Friday': 'Vrijdag',\n  'Saturday':\
        \ 'Zaterdag',\n  'Sunday': 'Zondag'} %}\n{% set dag = dagen[day] if day in\
        \ dagen else day %} {% set unit = 'Dag' if count == 1 else 'dagen' %}\n\n\
        {% if count < 30 %} {% set phrase = dag%}{% endif %} {{phrase}} {% if count\
        \ != 0%} (over {{count}} {{unit}}) {% endif %}\n"
      state: '{{state_attr(config.entity,''date'')}}

        '
      type: custom:template-entity-row
position: top
row_span: '1'
row_span_lg: '1'
row_span_xl: '1'
sort:
  method: state
  numeric: true

and the second cards (bottom right)

type: calendar
col_span: '2'
col_span_lg: '2'
col_span_xl: '2'
entities:
- calendar.gezin
initial_view: listWeek
position: top
row_span: '1'
row_span_lg: '1'
row_span_xl: '1'

It is also separate cards in stack :slight_smile:

Please use “normal” apostrophes in your posts rather than back-ticks as those are used to denote code, which is the reason for the odd formatting of your posts.

Well, I already fixed it differently. I managed to create a vertical-stack card and combined both cards together. bassicly forced Dwains dashboard to place them underneath each other.

I had a look at my card setup and here is the text.
I use two frontend integrations.
stack-in-card and card_mod
The stack-in-card remove completely the spaces between the cards.
The card mod remove borders, paddings and margins. The line with 0 0 0 16px is the space internally in the card and the 16px is especially the left padding.

I have played around a bit with the settings and here is the result.

type: custom:vertical-stack-in-card
cards:
  - type: markdown
    content: '# Bedroom 1'
    style: |
      ha-card {
        box-shadow: none;
        border: none;
        margin: 0;
      }
      ha-markdown.no-header {
        box-shadow: none;
        padding: 0 0 0 16px;
        border: none;
        margin: 0;
      }
  - type: markdown
    content: '# Bedroom 2'
    style: |
      ha-card {
        box-shadow: none;
        border: none;
        margin: 0;
      }
  - type: markdown
    content: '# Bedroom 3'
    style: |
      ha-card {
        box-shadow: none;
        border: none;
        margin: 0;
      }
      ha-markdown.no-header {
        box-shadow: none;
        padding: 0 0 0 16px;
        border: none;
        margin: 0;
      }
  - type: markdown
    content: '# Bedroom 4'
    style: |

      ha-markdown.no-header {
        box-shadow: none;
        padding: 0 0 0 16px;
        border: none;
        margin: 0;
      }

Nice!!! Thanks for the tip. Like already mentioned, I`ve merged both cards together so Dwains dashboard has to take is as 1 card…