Jump to content

Table with a background image


Recommended Posts

Is there a way to create a table with an image placed in the background? If so, can the image be sized to best fit the table dimensions? This table can have a variable amount of text, hence the height of the table can change.

 

I tried this code below, using the ShadeContent attribute to place an inline graphic. The resulting table had a black background, the image did not appear.

 

What is the correct code to make the background image appear?

 

var table1 = new FPTable;

table1.AddColumns(23000);

 

{

table1.AddRows(1);

table1.Rows[0].Cells[0].Margins = new FPTableMargins;

table1.Rows[0].Cells[0].HStraddle = 0;

table1.Rows[0].Cells[0].Margins.Top=150;

table1.Rows[0].Cells[0].Margins.Bottom=150;

table1.Rows[0].Cells[0].Margins.Left=200;

table1.Rows[0].Cells[0].Margins.Right=200;

table1.Rows[0].Cells[0].ShadeColor = '<graphic file=bboxPict.jpg>';

table1.Rows[0].Cells[0].ShadePct = 100;

table1.Rows[0].Cells[0].Content = bbox;

table1.Rows[0].Cells[0].TextColor="White";

}

 

return table1.MakeTags();

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...