A simple spreadsheet module for Angular5. (NO requirement for jQuery!)
npm install angular5-spreadsheetsrc folder
sheet.component.ts/html/css)
bash
$ npm install angular5-spreadsheet
`
(It might give warnings.)
And then from your Angular AppModule:
`typescript
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import the library
import { SheetModule } from 'angular5-spreadsheet';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
// Specify library as an import
SheetModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
`
Usage
Once library is imported, you can use its sheet component in your Angular application:
`html
`
Or you can pass some values to adjust sheet:
`html
`
1. row value determines how many rows there will be in sheet (default: 20)
2. column value determines how many columns there will be in sheet (default: 15)
3. minWidth value determines cells' minimum and starting width (default: 70)
4. minHeight value determines cells' minimum and starting height (default: 0)
Features
$3
You can do calculations in cells by adding = before your expression, like this:
> =5+3
And then simply pressing the enter key.
Also you can do things like this:
> =sqrt(PI)
You can use cells' values by using their ids:
> =B3-A7
$3
You can add images to cells by using [img][/img] tags:
> [img]https://i.imgur.com/Nj41c7V.png[/img]
And then simply pressing the enter key.
If you want to delete an image just click on it and press the backspace` key.