}
char **table_end(struct Table *table) {
- int row, col, tablewidth = 0, pos,i;
+ int row, col, tablewidth = 0, pos,i,j,k;
if(!table->entrys) return NULL;
for(col = 0; col < table->width; col++) {
tablewidth += table->maxwidth[col]+1;
if(table->col_flags[col] & TABLE_FLAG_COL_BOLD)
table->table_lines[row][pos++] = '\002';
i = 0;
+ j = 0;
if(table->contents[row][col]) {
for(; i < strlen(table->contents[row][col]); i++) {
table->table_lines[row][pos++] = table->contents[row][col][i];
+ if(table->contents[row][col][i] == '\002') j++;
+ else if(table->contents[row][col][i] == '\003') {
+ j++;
+ for(k = 1; k < 2; k++) {
+ if(isdigit(table->contents[row][col][i+k]))
+ j++;
+ else
+ break;
+ }
+ }
}
}
+ i -= j;
if(col < table->width-1) {
for(;i < table->maxwidth[col]; i++) {
table->table_lines[row][pos++] = ' ';