Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guitorres/htmlbuilder
This unit allows building simplified html with Delphi.
https://github.com/guitorres/htmlbuilder
Last synced: about 1 month ago
JSON representation
This unit allows building simplified html with Delphi.
- Host: GitHub
- URL: https://github.com/guitorres/htmlbuilder
- Owner: guitorres
- License: mit
- Created: 2015-05-15T16:54:51.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-15T12:58:08.000Z (about 6 years ago)
- Last Synced: 2024-01-09T01:14:56.541Z (5 months ago)
- Language: Pascal
- Homepage:
- Size: 30.3 KB
- Stars: 23
- Watchers: 5
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Lists
- awesome-pascal - HTMLBuilder
- awesome-delphi - HTMLBuilder
- awesome-delphi - HTMLBuilder
README
# htmlbuilder
This unit allows building simplified html with Delphi.## Hello world!
```delphi
var
html: THTMLReport;
begin
html := THTMLReport.Create;
try
html.Style := '*{font-size:15pt}';
html.AddParagraph('Hello World!', '');
ShowMessage(html.Build);
finally
html.Free;
end;
end;
``````html
*{font-size:15pt}
Hello World!
```
## easy table
```delphi
var
html: THTMLReport;
table: THTMLTable;
row: THTMLRow;
i,j: Integer;
begin
html := THTMLReport.Create;
table := THTMLTable.Create;
try
html.Style := '*{font-size:15pt}';
html.AddTable(table);for i := 1 to 100 do
begin
row := THTMLRow.Create;
for j := 1 to 5 do
row.AddCell(Format('Row %d Column %d', [i,j]), '');
table.RowList.Add(row);
end;ShowMessage(html.Build);
finally
html.Free;
end;
``````html
*{font-size:15pt}
Row 1 Column 1
Row 1 Column 2
Row 1 Column 3
Row 1 Column 4
Row 1 Column 5
Row 100 Column 1
Row 100 Column 2
Row 100 Column 3
Row 100 Column 4
Row 100 Column 5
```
## dataset to table
```delphi
table := THTMLTable.Create;
table.SetDataSet(cdsTest);
ShowMessage(table.Build);
```
## and morecheck the /demo directory