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.

Lists

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 more

check the /demo directory