cancel
Showing results for 
Search instead for 
Did you mean: 

Blox align containers horizontally

Priscillareagan
9 - Travel Pro
9 - Travel Pro

Hello there,

I'm a novice to customizing Blox templates. In the attached screenshot, I want to adjust the layout to make the cards appear side by side. I also want the titles Signups and orders to appear as a title to the card. Can I have suggestions on how I can modify the attached code to do that?

 

{
"style": "",
"script": "",
"title": "",
"showCarousel": true,
 
"body": [
{
"type": "Container",
"items": [
{
"type": "Container",
"separator": "true",
"spacing": "medium",
"items": [
{
"type": "TextBlock",
"spacing": "small",
"text": "Signups",
"weight": "bold",
"color": "grey",
"style": {
"padding-left": "20px"
}
},
{
"spacing": "none",
"type": "ColumnSet",
"columns": [
{
"spacing": "medium",
"separator": "true",
"type": "Column",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"style": {
"flex-grow": "0"
},
"items": [
{
"spacing": "none",
"type": "TextBlock",
"text": "{panel:Sign ups - Actual}",
"weight": "bold",
"color": "#232a2f",
"size": "extraLarge",
"style": {
"margin": "30px"
}
}
]
},
{
"type": "Column",
"style": {
"flex-grow": "100"
},
"items": [
{
"spacing": "none",
"type": "TextBlock",
"horizontalAlignment": "left",
"text": "Variance:",
"color": "grey",
"size": "small"
},
{
"spacing": "small",
"type": "TextBlock",
"horizontalAlignment": "left",
"text": "vs Budget:",
"color": "grey",
"size": "small"
},
{
"spacing": "none",
"horizontalAlignment": "left",
"type": "TextBlock",
"text": "{panel:Sign ups vs Budget}",
"weight": "bold",
"color": "#72767f",
"size": "medium"
},
{
"spacing": "small",
"type": "TextBlock",
"horizontalAlignment": "left",
"text": "vs RoFo:",
"color": "grey",
"size": "small"
},
{
"spacing": "none",
"horizontalAlignment": "left",
"type": "TextBlock",
"text": "{panel:Signups vs RoFo}",
"weight": "bold",
"color": "#72767f",
"size": "medium"
}
]
}
]
}
]
}
]
},
{
"type": "TextBlock",
"spacing": "small",
"text": "Orders",
"weight": "bold",
"color": "grey",
"style": {
"padding-left": "20px"
}
},
{
"spacing": "none",
"type": "ColumnSet",
"columns": [
{
"spacing": "medium",
"separator": "true",
"type": "Column",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"style": {
"flex-grow": "0"
},
"items": [
{
"spacing": "none",
"type": "TextBlock",
"text": "{panel:Orders - Actual}",
"weight": "bold",
"color": "#232a2f",
"size": "extraLarge",
"style": {
"margin": "30px"
}
}
]
},
{
"type": "Column",
"style": {
"flex-grow": "100"
},
"items": [
{
"spacing": "none",
"type": "TextBlock",
"horizontalAlignment": "left",
"text": "Variance:",
"color": "grey",
"size": "small"
},
{
"spacing": "small",
"type": "TextBlock",
"horizontalAlignment": "left",
"text": "vs Budget:",
"color": "grey",
"size": "small"
},
{
"spacing": "none",
"horizontalAlignment": "left",
"type": "TextBlock",
"text": "{panel:Orders vs Budget}",
"weight": "bold",
"color": "#72767f",
"size": "medium"
},
{
"spacing": "small",
"type": "TextBlock",
"horizontalAlignment": "left",
"text": "vs RoFo:",
"color": "grey",
"size": "small"
},
{
"spacing": "none",
"horizontalAlignment": "left",
"type": "TextBlock",
"text": "{panel:Orders vs RoFo}",
"weight": "bold",
"color": "#72767f",
"size": "medium"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}

Thanks,

Priscilla

2 REPLIES 2

ILLIA
Sisense Team Member
Sisense Team Member

Hello!

Hope you are doing well.
Kindly ask you to add this styling to the container that includes blocks that needs to be aligned horizontally:

 

"style": {
    "display": "flex",
    "flex-direction": "row"
}

 

More information about the approach:
https://css-tricks.com/snippets/css/a-guide-to-flexbox/#aa-flexbox-properties

Please inform if there are any questions.

Best regards,

ILLIA

DRay
Community Team Member
Community Team Member

Hello @Priscillareagan,

I wanted to follow up to see if the solution offered by @ILLIA worked for you.

If so, please click the 'Accept as Solution' button so that other users with the same questions can find the answer faster. If not, please let us know so that we can continue to help.

Thank you.

David Raynor (DRay)
Community Toolbox

Recommended quick links to assist you in optimizing your community experience:

Developers Group:

Product Feedback Forum:

Need additional support?:

Submit a Support Request

The Legal Stuff

Have a question about the Sisense Community?

Email [email protected]