- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2024 04:38 PM
Hi All,
Please let me know how to adjust Table borders in notification
template.print("<table border='1px solid black'>");
var gr = new GlideRecord('incident');
gr.addQuery('sys_id', current.sys_id.toString());
gr.query();
if (gr.next()) {
template.print("<tr><td> Number </td><td>" + gr.number.toString() + "</td></tr>");
template.print("<tr><td> Category </td><td>" + gr.category.toString() + "</td></tr>");
}
template.print("</table>");
Expecting Table format like below, can we make any changes to get it.
Number | INC0009003 |
Category | Inquiry |
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2024 10:43 PM
HI @Sironi
Can you check with this
template.print("<style>table { border-collapse: collapse; } table.outer { border: 10px solid black; } table, th, td { border: 1px solid black; }</style>");
template.print("<table class='outer'>");
Mark it Helpful and Accept Solution!! If this helps you to understand.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2024 08:58 PM
Hi @Sironi Here you have to remove the border attribute from the <table> tag to avoid duplication.
template.print("<style>table { border-collapse: collapse; } table, th, td { border: 1px solid black; }</style>");
template.print("<table>");
var gr = new GlideRecord('incident');
gr.addQuery('sys_id', current.sys_id.toString());
gr.query();
if (gr.next()) {
template.print("<tr><td> Number </td><td>" + gr.number.toString() + "</td></tr>");
template.print("<tr><td> Category </td><td>" + gr.category.toString() + "</td></tr>");
}
template.print("</table>");
Can you try with this once.
Mark it Helpful and Accept Solution!! If this helps you to understand.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2024 09:40 PM - edited 05-04-2024 09:42 PM
Hi @SK Chand Basha ,
Yes it is working...!
Can you please help me how come it is working
template.print("<style>table { border-collapse: collapse; } table, th, td { border: 1px solid black; }</style>");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2024 09:57 PM
Hi @Sironi Style tag contains CSS rule
- table { border-collapse: collapse; }: This rule sets the border-collapse property of tables to collapse, which removes the spacing between table cells.
- table, th, td { border: 1px solid black; }: This rule sets a solid black border with a width of 1 pixel for tables, table headers, and table cells.
In you case generates an HTML table element with a border style applied directly through an HTML attribute.
Mark it Helpful and Accept Solution!! If this helps you to understand.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2024 10:09 PM
Thanks for your explanation , one last concern can we make out-border should be very solid black ? like below