文本里的内容是这个样子的
比如:
编号 姓名 性别 住址
1 全 T
2 w F
3 FF F
在用表格把它框起来
比如:
编号 姓名 性别 住址
1 全 T
2 w F
3 FF F
在用表格把它框起来
解决方案 »
- delphi里如何索引?如何删除表?
- DBGrid显示问题二?
- 送分题,数据集字段格式化
- 在使用Opendialog选择文件后,再用TStringList.LoadFromFile()读入文件时出错,求救!
- 急~!!如果屏蔽EDIT、DBGRID中的粘贴功能????右键菜单粘贴也不要,CTRL+V也不要
- 一个字段的统计问题!应该很简单呀!
- dll中如何获取当前调用程序的路径?
- 如何把bcb编写的元件用在delphi里?
- 请问如何使TSaveDialog组件能自动给用户指定的文件名后加扩展名?
- 如何将Excel数据导入Access数据库?
- 救命!!我急需实现把SQL表转换成DB表,,用SQL语句///在线
- ? 急急急!!关于SQL SERVER里的IMAGE类型和ORCALE里的BLOBl类型!!!!
var
i, p: integer;
SStyle1, SStyle2, Text: string;
begin
Dest.Clear;
Dest.Lines.Add('<html>');
Dest.Lines.Add('<body>');
Dest.Lines.Add(' <table border="' + IntToStr(BorderSize) + '" width="' +
IntToStr(SG.Width) + '" height="' + IntToStr(SG.Width) + '">'); for i := 0 to SG.RowCount - 1 do
begin
Dest.Lines.Add(' <tr>');
for p := 0 to SG.ColCount - 1 do
begin
SStyle1 := '';
SStyle2 := '';
if fsbold in SG.Font.Style then
begin
SStyle1 := SStyle1 + '<b>';
SStyle2 := SStyle2 + '</b>';
end;
if fsitalic in SG.Font.Style then
begin
SStyle1 := SStyle1 + '<i>';
SStyle2 := SStyle2 + '</i>';
end;
if fsunderline in SG.Font.Style then
begin
SStyle1 := SStyle1 + '<u>';
SStyle2 := SStyle2 + '</u>';
end;
Text := sg.Cells[p, i];
if Text = '' then Text := ' ';
Dest.Lines.Add(' <td width="' + IntToStr(sg.ColWidths[p]) +
'" height="' + IntToStr(sg.RowHeights[p]) +
'"><font color="#' + IntToHex(sg.Font.Color, 6) +
'" face="' + SG.Font.Name + '">' + SStyle1 +
Text + SStyle2 + '</font></td>');
end;
Dest.Lines.Add(' </tr>');
end;
Dest.Lines.Add(' </table>');
Dest.Lines.Add('</body>');;
Dest.Lines.Add('</html>');
end; // Example, Beispiel
procedure TFormCSVInport.Button6Click(Sender: TObject);
begin
SGridToHtml(StringGrid1, Memo1, 1);
Memo1.Lines.SaveToFile('c:\test.html');
end;