CRC Cards?
Asked by Kevin Mote:

Has anyone come up with a simple template or macro that would enable easy addition of CRC cards? essentially I want a small panel/tabel/box divided inoto three sections like this:![](../../upfiles/SNAG_Program-0042.png)

I made this one using table and merged the top row. But since I am going to be making dozens or hundreds of these, I just want to be able to cut\& paste or use a macro to insert them. Unfortunately, there is a bug with the cut\&paste so that pasted tables look like this:

![](../../upfiles/SNAG_Program-0043.png)

where the top row gets truncated down to a single column. This isn't terrible, but it's annoying (especially with long class names, which stretch the first column way out). Any suggestions for a workaround?


Answers:
author: salehparsa
body: Hi Kevin,

Following is a user macro code that I tried for this example. You can following the steps below to recreate this macro:

Confluence Admin Panel \> User Macros \> Create a User Macro

1. Fill the mandatory fields such as **Macro Name** and **Macro Title**.
2. Select **Formatting** for categories.
3. Select **Escaped** for Macro Body Processing.
4. Copy and paste the following on **Template**

```
## @param classname:type=string|desc=Class Name## @param responsibility:type=string|desc=Responsibility Title## @param R1:type=string|desc=Responsibility One## @param R2:type=string|desc=Responsibility Two## @param collaborate:type=string|desc=Collaborate Title## @param C1:type=string|desc=Collaborate One## @param C2:type=string|desc=Collaborate Two#set ($paramHead1 ="CLASS NAME") &lt;div id="preformattedtable"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th colspan="2"&gt;$!paramclassname&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="1"&gt;&lt;p&gt;$!paramresponsibility&lt;/p&gt;&lt;ul&gt;&lt;li&gt;$!paramR1&lt;/li&gt;&lt;li&gt;$!paramR2&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td colspan="1"&gt;&lt;p&gt;$!paramcollaborate&lt;/p&gt;&lt;ul&gt;&lt;li&gt;$!paramC1&lt;/li&gt;&lt;li&gt;$!paramC2&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;
```

I would like to recommend you to take a look at [Writing User Macro Template](https://confluence.atlassian.com/display/DOC/Writing+User+Macros)documentation.

Let me know if you have any other questions,

Cheers

Saleh

comments: author: Kevin Mote
body: Wow, this is cool -- I've never used User macros before in Confluence. Thanks for taking the time to create and post this! But from what I can see, this isn't really extensible, is it? (I.e., there's no way to add, for example, 3 Responsibilites and 5 Collaborators without editing the macro code and html itself, is that right? Or am I missing something? I'm guessing I'd have to use some sort of javascript to make it more dynamic -- a little outside my skillset at the moment.)

The other disadvantage with this approach is that I can't view the table in Page-Edit mode. It just looks like this:

![](../../upfiles/crc.png)

I either have to preview the page or open the macro edit pane to actually see the table.

So I'm not sure that this is really a solution that will fit my needs. But again, I really appreciate the time you took to help me. And at least you have demonstrated the usefulness of User Macros which could come in really handy someday!


author: salehparsa
body: Hi Kevin,

You are most welcome. Wish I could help more.

As you said " I just want to be able to cut\& paste or use a macro to insert them." I thought that it's your predefined format. Maybe other people can modify this based on your need.

Cheers,

Saleh