لم ينجح معى Css + لم افهم فيه شىء .
توصلت الى المرغوب فيه ...
كود دالفى
- FUNCTION TWebModule1.Get_ListC():string;
- VAR
- vQueryListC : TMyQuery;
- Str ,C : String;
- I : LongWord;
- BEGIN
- Str:=''; I:= 0;
- vQueryListC:=TMyQuery.Create(nil);
- TRY
- WITH vQueryListC DO
- BEGIN
- Connection:=Con1;
- SQL.Text:='SELECT ID_C,LIB_C FROM compte ORDER BY LIB_C';
- TRY
- Open;
- WHILE NOT (Eof) DO
- BEGIN
- Case (I mod 2 ) oF
- 0:C:= '#DAE6FC' ;
- 1:C:= '#F0F8FF';
- end;
- str:= str +
- '<TR> ' +
- '<td bgcolor="'+c+'">'+ FieldByName('ID_C').AsString + '</td>' +
- '<td bgcolor="'+c+'">'+ FieldByName('LIB_C').AsString + '</td>' +
- '</TR>';
- END;
- EXCEPT ON E:exception DO
- Result:=E.Message;
- END;
- END;
- FINALLY
- vQueryListC.Free;
- Result:=str;
- END;
- END;
- procedure TWebModule1.pgplistcHTMLTag(Sender: TObject; Tag: TTag;
- const TagString: String; TagParams: TStrings; var ReplaceText: String);
- begin
- IF UpperCase(TagString) = 'LISTECOMPTE' THEN
- ReplaceText:= Get_ListC();
- IF (TagString) = 'scroll' THEN
- ReplaceText:=
- '<div style="height:300px;width:350px;overflow:scroll;">';
- end;
- procedure TWebModule1.WebModule1Admin_CAction(Sender: TObject;
- Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
- begin
- Response.Content:= Pgplistc.Content;
- end;
كود Html
- <html>
- <head>
- <title>Liste des Comptes</title>
- </head>
- <body>
- <#scroll>
- <table cellspacing="5" border="5" bgcolor="#FF8C00"bordercolor="skyblue">
- <TR> <td width="30%" bgcolor="#ffff00"><FONT COLOR="#ff0000">Code</Font></td><td width="50%"
bgcolor="#ffff00"><FONT COLOR="#ff0000">LIB</Font></td></TR> - <#LISTECOMPTE>
- </table>
- </div>
- </body>
- </html>
