Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi get number of rows and cols of a Table (https://www.delphipraxis.net/84005-get-number-rows-cols-table.html)

mr_fahrrad 9. Jan 2007 23:18


get number of rows and cols of a Table
 
Hi Again!

How I do that? if possible, in a selected table... I get the outerHtml and count the number of occourences of 'td' and 'tr', but is not a good method because merge cells..

I need a reference for commands of webbrowser (mshtml - ole), where I get it?

marabu 10. Jan 2007 06:29

Re: get number of rows and cols of a Table
 
Hi,

you should find everything you look for and more on this site: WebBrowser Control

Delphi-Quellcode:
function RowCount(doc: IHTMLDocument2; table: Variant): Integer;
var
  e2: IHTMLElement2;
  ec: IHTMLElementCollection;
  tbl: IHTMLTable;
begin
  e2 := doc.body as IHTMLElement2;
  ec := e2.getElementsByTagName('table');
  tbl := ec.item(table, null) as IHTMLTable;
  if Assigned(tbl)
    then Result := tbl.rows.length
    else Result := 0;
end;
Regards


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:44 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz