Even though Tabulizer does not have any built-in functionality for merging the data of two or more cells, this can be easily achieved by using a modification function. In this tutorial we will present a way of doing that by using the columnmerge modification function.
OK, let's start with our initial sample table:
Let's assume that we want to merge columns 1 and 2, so instead of displaying first and last name on separate columns we will combine these two columns into a single one that will show the full name (first + last name). We also want to add a space between the two combined columns, otherwise Mary Jane would be MaryJane and so on.
Therefore the merging argument becomes the following:
1+" "+2=2What this means is merge column #1, an empty space and column #2 and put the combined value into column #2. Generally speaking, the merging argument has the following format:
column id + ... + "string value" + .... = assigned column idApparently you cannot have double quotes inside a string value (as they are used for escaping the string value), but instead you should use the " notation. You can combine as many columns and string values as you wish. The assigned column id is the column that will receive the combined value, and it can in the merging input list as well.
After adding a table rule calling the columnmerge modification function with the merging argument em>1+" "+2=2 the result is the table below:
and here is the rule settings we used:
It looks good, but there is still one thing we need to do: to remove the first column that now it's redundant. This can be easily achived by adding a new column rule that will remove the first column.
The end result is the table below: