JNIsolutions.Net.HTMLlib
1.1.4
See the version list below for details.
dotnet add package JNIsolutions.Net.HTMLlib --version 1.1.4
NuGet\Install-Package JNIsolutions.Net.HTMLlib -Version 1.1.4
<PackageReference Include="JNIsolutions.Net.HTMLlib" Version="1.1.4" />
<PackageVersion Include="JNIsolutions.Net.HTMLlib" Version="1.1.4" />
<PackageReference Include="JNIsolutions.Net.HTMLlib" />
paket add JNIsolutions.Net.HTMLlib --version 1.1.4
#r "nuget: JNIsolutions.Net.HTMLlib, 1.1.4"
#:package JNIsolutions.Net.HTMLlib@1.1.4
#addin nuget:?package=JNIsolutions.Net.HTMLlib&version=1.1.4
#tool nuget:?package=JNIsolutions.Net.HTMLlib&version=1.1.4
HTML Document Generator
This is a .NET Core project written in C# that generates an HTML formatted document. The project allows users to create HTML documents programmatically.
Features
- Create HTML documents with custom content
- Add HTML elements such as headings, paragraphs, lists, and more
- Easy to extend and customize
Getting Started
Prerequisites
- .NET Core SDK 6.0 or later
Example
Here is an example of how to use the HtmlDocumentGenerator class to create an HTML document:
using HtmlDocumentGenerator;
class Program
{
static void Main(string[] args)
{
var document = new HtmlDocument();
Meta meta = new Meta
{
Name = "viewport",
Content = "width=device-width, initial-scale=1"
};
htmlDocument.Head.Tags.Add(meta);
htmlDocument.Head.Tags.Add(new Title("HTML Test Page"));
Link link1 = new Link
{
Rel = "stylesheet",
Href = "https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
};
link1.Elements.Add("Integrity", "sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN");
link1.Elements.Add("CrossOrigin", "anonymous");
htmlDocument.Head.Tags.Add(link1);
Hgroup hgroup = new Hgroup();
hgroup.Keywords.Add(new Heading("Welcome to this Test Page", 1));
hgroup.Keywords.Add(new Para("I like developing web pages"));
htmlDocument.Body.Tags.Add(hgroup);
OL oL = new OL();
oL.Keywords.Add(new LI("This is the first item on an ordered list."));
oL.Keywords.Add(new LI("This is the second item on an ordered list."));
htmlDocument1.Body.Tags.Add(oL);
UL uL = new UL();
uL.Keywords.Add(new LI("This is the first item on an unordered list."));
uL.Keywords.Add(new LI("This is the second item on an unordered list."));
htmlDocument1.Body.Tags.Add(uL);
Table table = new Table();
Caption caption = new Caption("Test Table");
Thead thead = new Thead();
TableRow tableRow1 = new TableRow();
HeaderCell header1 = new HeaderCell("Name");
HeaderCell header2 = new HeaderCell("Age");
tableRow1.Keywords.Add(header1);
tableRow1.Keywords.Add(header2);
thead.Keywords.Add(tableRow1);
Tbody tbody = new Tbody();
TableRow tableRow2 = new TableRow();
DataCell dataCell1 = new DataCell("John");
DataCell dataCell2 = new DataCell("17");
tableRow2.Keywords.Add(dataCell1);
tableRow2.Keywords.Add(dataCell2);
tbody.Keywords.Add(tableRow2);
TableRow tableRow3 = new TableRow();
DataCell dataCell3 = new DataCell("Wendy");
DataCell dataCell4 = new DataCell("16");
tableRow3.Keywords.Add(dataCell3);
tableRow3.Keywords.Add(dataCell4);
tbody.Keywords.Add(tableRow3);
Tfoot tfoot = new Tfoot();
TableRow tableRow4 = new TableRow();
DataCell dataCell5 = new DataCell("Average");
DataCell dataCell6 = new DataCell("16.5");
tableRow4.Keywords.Add(dataCell5);
tableRow4.Keywords.Add(dataCell6);
tfoot.Keywords.Add(tableRow4);
table.Keywords.Add(caption);
table.Keywords.Add(thead);
table.Keywords.Add(tbody);
table.Keywords.Add(tfoot);
htmlDocument1.Body.Tags.Add(table);
// Now that we have done all of the work, save the results to a file...
Console.WriteLine(htmlDocument.ToString());
string htmlFilePath = @"C:\Temp\TestHTML.html";
File.WriteAllText(htmlFilePath, htmlDocument.ToString());
}
}
| Product | Versions 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 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- No dependencies.
-
net6.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
At this stage not all HTML tags are implemented, but the commonly used ones are available. Future versions will progressively implement more tags.
This version now includes support for all TABLE and LIST elements.
All elements can now contain any of the global attributes and event attributes. Elements that have additional attributes defined that are not included in the global attributes are also supported.