Open Closed

CSS for Blazorise Data Grid #7352


User avatar
0
cellero created
  • ABP Framework version: v8.2.0-rc
  • UI Type: Blazor Web App

Can you please assist with the approach (CSS ??) for reducing the padding on each DataGrid row. I would like to reduce the white space on each row as it is takes up too much space. I am referring to the row areas marked in red below:

Presumably this will be achieved using CSS and will go in the main.css, I'd like assistance with the CSS markup

Thanks.


5 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    Could you please provide steps to reproduce or any code snippet you use for grid?

    Thanks

  • User Avatar
    0
    cellero created

    This is the default layout of a new project generated using ABP Suite - Blazor Web App 8.2.... This is not a new issue. It is the default behavior of the Blazorise DataGrid.

    You can reproduce this by creating a new Blazor project (any flavor of Blazor)

    I want to reduce the padding on each row.

    Thanks.

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    You may set padding in blazor-bundle.css file in the class

    .b-table.table tbody th, .b-table.table tbody td {
      padding: 1rem 1.25rem !important;
      vertical-align: middle;
    }
    

    You can download LeaptonX source code and check for the code

    Thanks

  • User Avatar
    0
    cellero created

    Hello, The blazor-bundle.css file is not part of the project. It only exists in the build output: So, I can't change it there, right?

    Can you please advise what project css file I can apply the suggested change.

    I have tried several in the Blazor and Blazor.Client + running the abp bundle command for the Blazor.Client.

    I don't want to download the LeptonX source

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello,

    You can create a custom css file under the wwwroot folder and add that custom css file to BundleContributor.

    Please refer to this similar issue for adding custom css files https://support.abp.io/QA/Questions/5193/How-to-add-custom-CSS-files-in-solution-and-render-them or you may refer to this doc https://docs.abp.io/en/abp/latest/UI/Blazor/Global-Scripts-Styles

    thanks

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11