The positioning of the Zorro table column remains flexible despite the presence of nzLeft

I am currently developing a project using Angular. Within one of my components, I have a table that displays some data. This table is generated by the ng-zorro table module.

However, I've encountered an issue where setting a table column or header with the property nzLeft does not keep the column fixed as intended.

To troubleshoot this problem, I created a sample Angular 14 project on StackBlitz where the nzLeft property works correctly: View demo here

Below is the content of my package.json:

{
  "name": "ore-commesse-app",
  ...
}

Additionally, here is the code for my table HTML component,

registration-statistic-component.html
:

<nz-table #fixedTable [nzData]="listOfData" [nzScroll]="{ x: '1150px', y: '240px' }">
  ...
</nz-table>

And lastly, my registration-statistic.module.ts:

import { NzTableModule } from 'ng-zorro-antd/table';
...
export class RegistrationStatisticModule { }

I've noticed in the StackBlitz example that the columns are fixed properly, unlike in my actual implementation where I can scroll over them. Here's how it looks: Table screenshot

If anyone has any insights or possible solutions to this problem, your help would be greatly appreciated!

Answer №1

After some investigation, I was able to pinpoint the issue:

  • I started a new project in angular 14 and implemented ng zorro table with fixed columns and header
  • Initially, everything seemed to be functioning properly.
  • It became clear that the problem was not related to the Angular version itself.
  • Upon inspecting my page using Chrome developer tools, I couldn't identify any missing elements.
  • However, upon reviewing my .css file, I noticed that certain code was conflicting with ng zorro implementation

More precisely, removing the following code resolved the problem:

.ant-table-measure-now {
  display: none;
}

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

Switching hover behavior on dropdown menu for mobile and desktop devices

I have implemented a basic JavaScript function that dynamically changes HTML content based on the width of the browser window. When in mobile view, it removes the attribute data-hover, and when in desktop view, it adds the attribute back. The functionalit ...

Is it possible to import a custom module after an Angular 2 app has been bootstrapped?

I'm currently in the process of developing a business web application using Angular2 that is based on a web API. But I've encountered a challenge. My goal is to bootstrap my Angular2 app using AuthModule, which is a custom module I have created. ...

The issue of the background image not updating with jQuery persists in Internet Explorer 11

Hello everyone, I am facing an issue where I am trying to change the background image of a div using jQuery on click. The code I have written works perfectly on all browsers except for IE. Can someone please provide me with some guidance or help on how to ...

Storing a value in the store while dispatching an action is resulting in an undefined return

Is there a recommended method for passing a value into my store to update the current value? I've attempted the following code but encountered an issue where setSelectedCourseContentUid is being set as undefined in my component: setSelectedCourseCo ...

What is the correct method to define the width as a percentage while also maintaining a minimum width in pixels?

My header/navigation bar div features a repeat-x background image. Within this, I have a horizontal navigation that needs to be centered over the background with a specified min-width and normal width. I want the navigation to be 80% of the full width, wi ...

Using z-index to overlay a background image with transparency

I'm attempting to make a partially transparent div with text on top. My approach involves creating a parent tag with relative positioning. I have one child span with transparency set using the class .body-content-background and another child containi ...

Transforming Post Requests into Options Requests

I am facing an issue with my Angular 6 API. After creating interceptors, my POST requests are turning into OPTIONS requests. What could be causing this problem? Here is the code for one of the Services: import { Injectable } from '@angular/core&apo ...

Learn about how to pass HTML content as an input variable in Angular 8

When it comes to passing input props or data, we typically use @Input. Another option is using <ng-content> to insert a bunch of HTML into the children component. Is there any way to pass HTML as an Input in Angular? For example, using @Input html1 a ...

Is there a simpler and more refined approach for handling Observables within RxJS pipelines?

Picture this: I have an observable that gives me chocolate cookies, but I only want to eat the ones without white chocolate. Since I am blind, I need to send them to a service to determine if they are white or not. However, I don't receive the answer ...

How can I utilize formGroupName and pass it to a different component?

Here is the template I am working with: <mat-form-field class="dense no-bottom" appearance="fill" style="min-width: 8em; flex: 1;"><mat-label>{{ label | translate}}</mat-label><mat-select formControlName=& ...

Attempting to rearrange the table data by selecting the column header

In an attempt to create a table that can be sorted by clicking on the column headers, I have written code using Javascript, HTML, and PHP. Below is the code snippet: <?php $rows=array(); $query = "SELECT CONCAT(usrFirstname,'',usrSurname) As ...

What is the best way to create a Div element that functions as a button, becoming active when clicked while deactivating all other Div elements

function toggleButton1() { $("#button1").toggleClass("button-active button-inactive"); $("#button2").toggleClass("button-inactive button-active"); $("#button3").toggleClass("button-inactive button-active"); } function toggleButton2() { $("#butto ...

What are some strategies to prevent a fixed sidebar from obscuring content while zooming in?

I've been working on adding a fixed sidebar for a table of contents (TOC) to a website, where the sidebar stays in place as the user scrolls up and down. My implementation includes the following HTML code: and CSS code: I took inspiration from a tu ...

Creating a mandatory 'Select' dropdown field in Vue.js

Hello, I am a beginner in VueJS and I am trying to make a select element from a drop-down list required. I attempted to add the required attribute as shown in the code below. Any suggestions on how to achieve this? Thanks. <v-select ...

Navigating the web page and locating the appropriate Xpath element to extract

Here is the HTML that needs to be extracted: <input type="hidden" id="continueTo" name="continueTo" value="/oauth2/authz/?response_type=code&client_id=localoauth20&redirect_uri=http%3A%2F%2Fbg-sip-activemq%3A8080%2Fjbpm-console%2Foauth20Callbac ...

Hide when reaching the end with d-none

One of the challenges I'm facing is aligning a button to the right side of a column while still utilizing d-none to control its display. Previously, I used d-flex justify-content-md-around justify-content-lg-end for alignment before adding d-none, but ...

Exploring the possibilities of customizing themes in Angular Material with Stylus for Angular 5

My project is currently utilizing the "stylus" CSS pre-processor instead of SCSS. I am interested in incorporating Angular Material themes and switching between them. While I can find documentation for SCSS, I am struggling to find resources for stylus. ...

Fetching values from JSON object using Key in Angular

Here is the code snippet for the markup and component in question: new.component.html <a routerLink="{{sub.name}}" routerLinkActive="active">{{sub.name}}</a> old.component.ts data; this.route.params.subscribe((params:any) => {console.lo ...

The mobile version of my website's home page is not displaying certain elements of the featured image

I'm in the process of launching a fresh new blog with Flask as the backend. Currently, I'm using a Bootstrap template and have set an image as the featured image. While it displays properly on computers, tablets crop it out. You can check out the ...

Import JSON Data into Angular-nvD3 Chart (AngularJS)

I am seeking help to load encoded JSON Data retrieved from a database via queries into an Angular-nvD3 graph. I am unsure about the best approach to achieve this task. The encoded JSON data is fetched using API queries from a database table called PRODUCT ...