The class "col-md-*" is not functioning properly when used with an Infragistics grid

I am working with a simple HTML table and an Infragistics (igx) grid to display data:

<div class="container">
    <div class="row">
        <div class="col-md-4"> 
           <table> </table>
        </div>
        <div class="col-md-8">
           <igx-grid #grid1 [data]="localData" [autoGenerate]="true"></igx-grid>
        </div>
    </div>
</div>

Here is the CSS I have used:

@import "~igniteui-angular/lib/core/styles/themes/index";
@include igx-theme($default-palette);


  table { 
    width: 100%; 
    border-collapse: collapse; 
  }
  th { 
    background: #333; 
    color: white; 
    font-weight: bold; 
  }
  td, th { 
    padding: 6px; 
    border: 1px solid #ccc; 
    text-align: left; 
  }

This is a snippet from my package.json file:

  "dependencies": {
    "@angular/animations": "~8.2.14",
    "@angular/common": "~8.2.14",
    "@angular/compiler": "~8.2.14",
    "@angular/core": "~8.2.14",
    "@angular/forms": "~8.2.14",
    "@angular/platform-browser": "~8.2.14",
    "@angular/platform-browser-dynamic": "~8.2.14",
    ... (additional dependencies)
    
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.803.19",
    "@angular/cli": "~8.3.19",
    ... (additional dev dependencies)

I tried placing both the table and the grid on the same row but it didn't work as expected. I'm wondering if the igx related CSS is causing any conflicts. Upon inspecting the styles in the developer tools, it seems to be using "core.scss" and "minireset.css". How should I proceed from here?

Answer №1

There should be no conflict between the packages or the Ignite UI for Angular theme and Bootstrap's grid classes. The igx-theme rules specifically target components and font properties under the .igx-typography class. The global rules in minireset.css address browser inconsistencies with basic elements.

Keep in mind that unless these styles are imported in your styles.scss, added as styles in the angular.json config, or included in the index.html page, they will not affect your running app. It appears that you may be missing the Bootstrap CSS.

You should include something like:

<link rel="stylesheet"
    href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" />

in your index.html as shown in examples from @ng-bootstrap.

This approach seems to work well, as seen here:

Stackblitz link: https://stackblitz.com/edit/angular-8gmxfj

PS: You also have the bootstrap package installed, so you could import directly from there:

@import "~bootstrap/dist/css/bootstrap";

I'm unsure why both packages are being used, considering that the bootstrap package includes peer dependencies on jquery and popper.js, which is why ng-bootstrap replaces it for Angular usage.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What steps should be followed to properly validate an unsubmitted form in Angular?

To ensure that the user submits the form before navigating to another page, I want to implement a feature where an error dialog pops up if the user types in the form but hasn't submitted it yet and tries to click a link to go to a different page. How ...

Getting rid of the border on a material-ui v4 textbox

I am currently using Material-UI version 4 and have not upgraded to the latest mui v5. I have experimented with various solutions, but so far none have been successful. My goal is simply to eliminate or hide the border around the textfield component. < ...

Align child elements in the middle horizontally within a col-lg-4 class using Bootstrap

I am currently working with Bootstrap 4.3.1 and utilizing flex for my page layout. <div class='row d-flex align-items-center'> <div class='col-lg-12'> <div class="form-group row"> ...

Incorporating npm packages into an Angular2 (v2.0.0-rc.1) application

Struggling with integrating npm libraries into my Angular2 app has been a challenge, especially when trying to include https://github.com/manfredsteyer/angular2-oauth2. Every time I try to import the library, I encounter a 404 error. Even after adding the ...

"Implementing a Filter for Selecting Multiple Options in Ionic Framework

I need help with filtering books in an online library project using a modal page. The modal has 3 input fields for title, author, and year. How can I filter the books based on these inputs? Here is a snippet of my modal.html code: <ion-content pa ...

Show the Select component in a grid format with a list view, displaying three items per row

Within my react Dropdown component, there is currently a list view displayed when an item is selected. However, I am looking to modify it so that the items are arranged in a grid format with 3 items per row. Sample Code: import { Dropdown } from 'pri ...

Incorporate the latest value into an array of objects using JavaScript, taking into account its frequency

Hey there, I have an array of objects where I need to add a new property or value to each object based on its order number occurrence. For example, in the array of objects, there is a property called order number. If an object contains the highest order n ...

What is preventing the addition of links to the navigation bar when using a sticky navigation bar?

Currently, I am in the process of developing a blog website using Django. One of the features I have successfully implemented is a sticky navigation bar. However, I am facing a challenge with adding links to the menu on the navigation bar due to existing ...

Retrieve every hour between two specific timestamps

I am attempting to retrieve all dates between two timestamps that fall on a specific day of the week. I have a start date represented by 'start1' and an end date represented by 'end1'. Additionally, I have a list of days with correspon ...

At what point does IE7 recalculate styles? It seems to have difficulty functioning consistently when a class is applied to the body

Currently facing a peculiar issue. I'm utilizing a class on the element as a toggle switch to control various layout behaviors on my website. When the class is active, specific actions occur; when it's inactive, these actions do not take place. ...

Adding services to an Angular class instance for dependency injection

When attempting to utilize an instance of a class within a static property of another class, I encountered the following issue: class MyHelper { private authService: AuthService; constructor() { this.authService = inject(AuthService); this ...

Tips for improving the styling of a django form with mixed elements

Here are two different forms I am working with: class InitialForm(Form): trn = IntegerField(widget=NumberInput, required = False) klient = ChoiceField(choices=KLIENTS, required = False) class SecondForm(Form): faktura = CharField(max_length = ...

Display an array depending on the value in Angular 2 when clicked

In my current Angular 2 project, I am dealing with a .json file structured like this: { "PropertyName": "Occupation", "DefaultPromptText": "occupation text", "ValuePromptText": { "WebDeveloper": "for web developer", "Administra ...

Retrieving selected values from an ngx dropdown list

I am having trouble implementing ngx dropdown list in this way: <ngx-dropdown-list [items]="categoryItems" id="categoriesofdata" [multiSelection]="true" [placeHolder]="'Select categories'"></ngx-dropdown-list> ...

The elements are stacked on top of each other, but unfortunately, the scroll

While scrolling the page, I encounter a small issue where the elements stack on top of each other. Additionally, when I perform a search, the elements move with the keyboard. I have attached screenshots to illustrate the problem. My goal is to have the cat ...

Issues accessing Firebase object in Angular5

After creating a sample Firebase object in the Firebase console, I tried to retrieve the object in my Typescript code. Unfortunately, following the steps outlined in this tutorial did not yield any success. Can anyone provide guidance on how to achieve thi ...

What is the best way to clear and fill a div without causing it to resize?

I am faced with a challenge involving four thumbnail divs labeled .jobs within a #job-wrap container. When a .job is clicked, I want the #job-wrap to fade out, clear its contents, load information from the selected .job, and then fade back in. However, whe ...

The loading template remains visible despite the Eventsource being closed when using the Async Pipe

How can I resolve the issue I'm facing with the Angular async pipe and event source while using Spring boot WebFlux? I need to display a "loading data" message until the API call is complete. Once the API fetches data, I want to show the retrieved dat ...

I don't want my background image to repeat, but I'm not sure how to stretch out the tile

Hey there, I would appreciate it if you could refrain from criticizing me or giving me negative feedback as I have put in the effort to search for an answer. After extensive research, this is what I have found so far. My goal is to set a background image f ...

Triggering a subsequent action in Ngrx depending on the data from the initial action

Currently, I am fetching a list of users using ngrx: this.users$ = this.store.select(fromReducer.getUsers); In my HTML template: <ul> <li *ngFor="let user of users$ | async"> {{user.id}} - {{user.name}} - {{user.email}} </ ...