I am currently facing an issue while trying to integrate a Handsontable into my Angular frontend. I was able to successfully implement the basic example from in a new Angular project. However, when I tried to add the exact same code to my existing repository, I encountered a problem where the necessary CSS styles were not being applied. Upon inspecting the sources in my browser, I found that the stylesheet was imported but the styles were not being rendered properly, causing the table to appear misaligned and distorted.
Here is the source code:
<div>
<hot-table
[data]="dataset"
[colHeaders]="true"
[rowHeaders]="true"
height="auto"
licenseKey="non-commercial-and-evaluation">
<hot-column data="id" [readOnly]="true" title="ID"></hot-column>
<hot-column data="name" title="Full name"></hot-column>
<hot-column data="address" title="Street name"></hot-column>
</hot-table>
</div>
component:
import { Component } from '@angular/core';
import * as Handsontable from 'handsontable';
@Component({
selector: 'app-root',
templateUrl: './table.component.html',
styleUrls: ['./app.component.css']
})
class AppComponent {
dataset: any[] = [
{id: 1, name: 'Ted Right', address: 'Wall Street'},
{id: 2, name: 'Frank Honest', address: 'Pennsylvania Avenue'},
{id: 3, name: 'Joan Well', address: 'Broadway'},
{id: 4, name: 'Gail Polite', address: 'Bourbon Street'},
{id: 5, name: 'Michael Fair', address: 'Lombard Street'},
{id: 6, name: 'Mia Fair', address: 'Rodeo Drive'},
{id: 7, name: 'Cora Fair', address: 'Sunset Boulevard'},
{id: 8, name: 'Jack Right', address: 'Michigan Avenue'},
];
}
styles
@import '~handsontable/dist/handsontable.full.css';
I would greatly appreciate any assistance or guidance on this matter!