Goffo.BlazorSimpleDataTable 1.0.0

dotnet add package Goffo.BlazorSimpleDataTable --version 1.0.0
NuGet\Install-Package Goffo.BlazorSimpleDataTable -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Goffo.BlazorSimpleDataTable" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Goffo.BlazorSimpleDataTable --version 1.0.0
#r "nuget: Goffo.BlazorSimpleDataTable, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Goffo.BlazorSimpleDataTable as a Cake Addin
#addin nuget:?package=Goffo.BlazorSimpleDataTable&version=1.0.0

// Install Goffo.BlazorSimpleDataTable as a Cake Tool
#tool nuget:?package=Goffo.BlazorSimpleDataTable&version=1.0.0

README

This README would normally document whatever steps are necessary to get your application up and running.

What is this repository for?

  • Provides an easy way to create a simple HTML table in Blazor
  • NuGet Package ID: Goffo.BlazorSimpleDataTable
  • Learn Markdown

How do I get set up?

  • Use your own string of Header Names by Settinge TableHeaders or leave blank to use the class properties
@page "/"

<SimpleDataTable Items=GetPeople()
                 TableCssClass="table table-bordered table-striped table-responsive"
                 TableHeaders="GetHeaders()">
</SimpleDataTable>

@code
{
    private List<string> GetHeaders()
    {
        var headers = new List<string>
        {
            "First Name",
            "Last Name",
            "Age",
            "Email Address"
        };

        return headers;
    }

    private List<PersonModel> GetPeople()
    {
        var people = new List<PersonModel>
        {
            new PersonModel()
            {
                FirstName = "John",
                LastName = "Doe",
                Age = 22,
                EmailAddress = "john.doe@gmail.com"
            },
            new PersonModel()
            {
                FirstName = "Jane",
                LastName = "Doe",
                Age = 21,
                EmailAddress = "jane.doe@gmail.com"
            },
            new PersonModel()
            {
                FirstName = "Mystery",
                LastName = "Man",
                Age = 42,
                EmailAddress = "mystery.man@gmail.com"
            },
            new PersonModel()
            {
                FirstName = "Mystery",
                LastName = "Woman",
                Age = 42,
                EmailAddress = "mystery.woman@gmail.com"
            }
        };

        return people;
    }
}

  • Model - Leave TableHeaders Blank to use the Properties attributes: default, DisplayAttributeName or DisplayName
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

public class PersonModel
{
    public PersonModel() { }

    public PersonModel(string firstName, string lastName, byte age, string emailAddress)
    {
        FirstName = firstName;
        LastName = lastName;
        Age = age;
        EmailAddress = emailAddress;
    }

    [Display(Name = "First Name")]
    public string? FirstName { get; set; }

    [DisplayName("Last Name")]
    public string? LastName { get; set; }

    public byte Age { get; set; }

    [DisplayName("Email Address")]
    public string? EmailAddress { get; set; }
}

Contribution guidelines

  • Contact Repo owner or admin

Who do I talk to?

  • Contact Repo owner or admin
  • Other community or team contact
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 143 1/9/2024

Initial release.