KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Make multiple cards to be the same size #2746

Open Richb201 opened this topic on on Jul 3, 2022 - 6 comments

Richb201 commented on Jul 3, 2022

I recently got my yearly bill for koolreport which i happily paid as I have for at least 3 years.

I have been asking about this issue for a few months and have gotten no response.

Look at this screen. Each of these cards is s button. How can I align these and make them all the same size. I am looking to make my app look professional.

Sebastian Morales commented on Jul 4, 2022

Pls set your cards' or panels' width to be fixed and wider than your maximum text length so that they all have the same width and height.

Richb201 commented on Jul 5, 2022

I am unable to find a width setting. Here is what I have:

            <?php
            SimpleCard::create(array(
                "href"=>"business_component_management",
                "title"=>"<br><br>Step2: Add Business Component",
                "value"=>$this->dataStore("global_summary")->get(0,"num_buscomps"),
                "preset"=>$iColor2,
                "cssClass"=>array(
                    "icon"=>"fas fa-laptop-code",
                    "card"=>"p-3",
                ),
            ));
            ?>

Can you point me to a description of how to set the width to fixed for SimpleCard?

Sebastian Morales commented on Jul 6, 2022

Most of card widgets have "cssClass" and "cssStyle" properties:

https://www.koolreport.com/docs/amazing/simplecard/#cssclass

https://www.koolreport.com/docs/amazing/simplecard/#cssstyle

You could set the card width via css rules using fixed width or with css classes of your css grid system, e.g Bootstrap's row and column classes:

https://getbootstrap.com/docs/4.0/layout/grid/

Richb201 commented on Jul 6, 2022

I am not sure how to do this. In the above code would I just set "card" to =>"max-width=100px"? I havent found any directions on how to do this on Google.

Richb201 commented on Jul 7, 2022

Thanks for your excellent guidance. Here is what I see from the Koolreport docs:

cssStyle #
Alternative to set the cssClass, you may directly set the css style to the card element:

Name	type	default	description
card	string		Css style for card
title	string		Css style for card title
value	string		Css style for card value
icon	string		Css style for card icon
Example:

SimpleCard::create(array(
    "cssStyle"=>array(
        "card"=>"background-color:yellow",
        "title"=>"font-weight:bold",
        "value"=>"font-style:italic",
        "icon"=>"font-size:24px;color:#333"
    )
));

perhaps I am missing something? I don't see a max-width? Is there a list of what indexes can be used for value or for card?

Sebastian Morales commented on Jul 8, 2022

If you use Bootstrap in your project, you could copy this example view code:

https://www.koolreport.com/examples/reports/amazing-theme/simplecard/

There we use row and column css classes (by default there're 12 columns per row, i.e 4 col-md-3 per row):

    <div class="row">
        <div class="col-md-3">
            ...
        </div>
    </div>

to keep the cards the same size.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

None