Forum > FPvectorial

How to make thinner lines of the table?

(1/2) > >>

izumsasha:
Hello!
Please tell me - is it possible to set the thickness of the lines of the table?
Thank!

wp:
Please provide more information. fpvectorial supports many formats, and it is not clear which one you are using. Ideally you should post a compilable sample project which shows the issue (put .pas, .lfm, .lpr and .lpi files into a common .zip which you can upload here under "Attchments and other options"; don't add binaries and other compiler-generated files).

izumsasha:

--- Quote from: wp on November 26, 2018, 09:32:32 am ---Please provide more information. fpvectorial supports many formats, and it is not clear which one you are using. Ideally you should post a compilable sample project which shows the issue (put .pas, .lfm, .lpr and .lpi files into a common .zip which you can upload here under "Attchments and other options"; don't add binaries and other compiler-generated files).

--- End quote ---

I just took your example on creating a simple table and saving a document (http://wiki.freepascal.org/fpvectorial_-_Text_Document_Support). Also an example procedure in an application.

wp:
Strange, this example does not compile for me. I had to modify setting of the col widths and some other places.

Anyway, after studying the source code I found that each cell has a field "Borders" which, in turn, contains elements "Left", "Right", "Top" and "Bottom"; and these have an element "Width" for the border width in millimeters. Unfortunately this is initialized with the value 1 mm which seems to be too large, in my eyes - 0.1 mm would be better.

You can do this: Whenever you create a cell call the following procedure: it changes the border widths to 0.1 mm and sets the LineType of the border to tbtSingle (this is necessary because borders with the standard line type, tbtDefault, are not written to the file).


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure DefaultBorder(var ABorder: TvTableBorder);begin  ABorder.Width := 0.1;  ABorder.LineType := tbtSingle;end; procedure DefaultCell(ACell: TvTableCell);begin  DefaultBorder(ACell.Borders.Left);  DefaultBorder(ACell.Borders.Right);  DefaultBorder(ACell.Borders.Top);  DefaultBorder(ACell.Borders.Bottom);end;...      for iCol := 0 to 4 do      begin        Cell := Row.AddCell;        DefaultCell(Cell);     // <---- NEW

izumsasha:

--- Quote from: wp on November 26, 2018, 11:48:51 am ---
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure DefaultBorder(var ABorder: TvTableBorder);begin  ABorder.Width := 0.1;  ABorder.LineType := tbtSingle;end; procedure DefaultCell(ACell: TvTableCell);begin  DefaultBorder(ACell.Borders.Left);  DefaultBorder(ACell.Borders.Right);  DefaultBorder(ACell.Borders.Top);  DefaultBorder(ACell.Borders.Bottom);end;...      for iCol := 0 to 4 do      begin        Cell := Row.AddCell;        DefaultCell(Cell);     // <---- NEW
--- End quote ---

Works!
Lazarus forever!

Navigation

[0] Message Index

[#] Next page

Go to full version