I would like to create a table using a Cascading Style Sheets (CSS) and I am not sure how to have it displayed on the form. So far, I have a computed text field that is a loop of items from another table. The computed text has “Pass Thru HTML” selected and uses the formula below:
strHTML := “
”;
table := @For(i := 1; i <= @Elements(AXE_RRLIBDIR); i := i + 1;
strHTML := strHTML + “
”);
@Trim(strHTML) + “
| ” + AXE_RRLIBDIR[i] + “ | ” + AXE_RRFILEMEMBER[i] + “ | ” + AXE_CLMDT[i] + “ | ” + AXE_RRMFRMAFF[i] + “ | ” + AXE_RRARCH[i] + “ |
”
The CSS I created is very simple (once I figure out how to have the table displayed, I’ll make the table more complex) and it uses the “sample” class. Below is the CSS code:
sample.TABLE {
border-width: 1px;
border-style: outset;
border-color: gray;
border-collapse: separate;
background-color: white;
}
sample.TD {
border-width: 1px;
padding: 1px;
border-style: inset;
border-color: gray;
background-color: white;
}
Extra information: The two tables (one table is already created and the other should be created by CSS) are on the subform and I have “Render pass through HTML in notes” checked for the subform. The subform is on a form, that does not have “Render pass through HTML in notes” checked. When I open it in notes client, I can see the values of the table but not the design of the table.
Can anyone advise me on how to be able to see the design of the table? Thanks in advance!
Subject: RE: Creating a table using CSS
When I open it in notes client, I can see the values of the table but not the design of the table.
Does this mean that you don’t see a table at all, or that your styles do not seem to have been applied (i.e. the table has its default appearance)?
What happens if you put a regular table on the form? Does it have the CSS-defined attributes?
How did you apply the CSS to this form? Are you sure the CSS widget on the form isn’t hidden in Notes?
Subject: RE: Creating a table using CSS
Andre, thanks for your response. What I can see if the values in the table but not the actual table itself. What I mean is that I do not see the design. When you say “regular table”, did you mean by using Create Table action? If so, it does not have CSS defined attributes but I am using it as a format for the table I’m trying to create using CSS. I applied the CSS by using a div class,
. If that is wrong, please let me know. Lastly, can you explain what a CSS widget is?
Subject: RE: Creating a table using CSS
I’m assuming you have created a CSS design element, separate from the form. Is that correct? Under “Shared Resources / Style Sheets” in the Designer outline?
Then, to make use of the CSS on a form, you need to include the CSS on the form. Open form in designer, go to the top, and use Create / Resource / Insert Resource, select Style sheet in the list, and choose your style sheet. Make sure the paragraph is not hidden to the Notes client, or it will ignore the stylesheet in the Notes client. The embedded stylesheet appears on the form as a tiny page icon. This is what I’m calling the “stylesheet widget”.
I believe this is the only way the Notes client will recognize the style sheet and apply its contents. I don’t know whether it will pay attention to any styles defined in passthru HTML, especially if they are not in the same block of passthru HTML as the data you are rendering.
CSS is not fully implemented in the Notes client, and I’m not sure how well it will recognize the application of a style in a
tag – especially, again, if it’s not all in the same “run” of passthru HTML. It might work better to put the class name on the TABLE tag. I’m not sure whether what you’re trying to do will work at all; you might have to put styles on the parts of the table, rather than trying to apply a class.
By “regular table,” yes, I mean you edit the form in Designer and use Create / Table.
You say, “What I can see [is] the values in the table but not the actual table itself. What I mean is that I do not see the design.” This is still ambiguous. What precisely do you see? Do you see the HTML codes? Do you see the data all jammed together? Do you see the data lined up as if there were a table, but the table is not visible? I don’t understand what “seeing the design” means to you.
Subject: RE: Creating a table using CSS
What precisely do you see? Do you see the data lined up as if there were a table, but the table is not visible?
The answer is yes, I do see the data lined up as if there were a table, but the table is not visible. Sorry that I was not clear on this. Andre, thanks for your helpful response.
Subject: Creating a table using CSS
try to put “[” in the beginning of the html string and “]” at the end of the html string.
Subject: RE: Creating a table using CSS
Thanks for your response Rachhpal. I tried your suggestion and when I opened the form, it’ll show the values of the table with “[” instead of the table design. Any other suggestions?