You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: collapsed_table.rs
    path of file: ./repos/tabled/json_to_table/src/table
    
    the code of the file until where you have to start completion: use std::{
    cmp::{self, max},
    collections::HashMap,
    iter::repeat,
};

use serde_json::Map;
use tabled::{
    builder::Builder,
    grid::{
        config::{AlignmentHorizontal, AlignmentVertical, ColoredConfig, Entity, Offset},
        dimension::{Dimension, Estimate},
        records::Records,
        util::string::{count_lines, get_lines, string_dimension, string_width},
    },
    settings::{Padding, TableOption},
};

use super::*;

#[derive(Debug, Default)]
struct PrintContext {
    pos: usize,
    is_last_col: bool,
    is_last_row: bool,
    is_first_col: bool,
    is_first_row: bool,
    kv: bool,
    kv_is_first: bool,
    list: bool,
    list_is_first: bool,
    no_left: bool,
    no_right: bool,
    no_bottom: bool,
    lean_top: bool,
    top_intersection: bool,
    top_lef
    
fn generate_value_cell(value: &str, cfg: &Config, ctx: PrintContext) -> CellData {
    let value = config_string(value, &cfg.cfg, ctx.size.width, ctx.size.height);

    let mut table = tabled::builder::Builder::from(vec![vec![value]]).build();
    table.with(cfg.cfg.clone());

    if !ctx.is_last_row || ctx.no_bottom {
        table.with(NoBottomBorders);
    }

    if ctx.no_right {
        table.with(NoRightBorders);
    }

    if ctx.kv && ctx.kv_is_first {
        table.with(TopLeftChangeTopIntersection);
    }

    if ctx.kv && !ctx.kv_is_first {
        table.with(TopLeftChangeIntersection);
    }

    if ctx.kv && ctx.list && !ctx.list_is_first {
        table.with(TopLeftChangeToLeft);
    }

    if ctx.is_last_col && !ctx.is_first_row {
        table.with(TopRightChangeToRight);
    }

    if !ctx.is_first_col && ctx.is_last_row {
        table.with(BottomLeftChangeToBottomIntersection);
    }

    if ctx.is_first_col && !ctx.is_first_row {
        table.with(TopLeftChangeToLeft);
    }

    if ctx.lean_top {
        table.with(TopLeftChangeTopIntersection);
    }

    if ctx.top_left {
        table.with(TopLeftChangeToLeft);
    }

    if ctx.top_intersection {
        table.with(TopLeftChangeIntersection);
    }

    let has_vertical = cfg.cfg.get_borders().has_left();
    if !ctx.intersections_horizontal.is_empty() && has_vertical {
        let mut splits = ctx.intersections_horizontal;
        let mut splits = short_splits(&mut splits, ctx.size.width);
        squash_splits(&mut splits);

        let c = cfg.cfg.get_borders().bottom_intersection.unwrap_or(' ');
        table.with(SetTopChars(&splits, c));
    }

    let has_horizontal = cfg.cfg.get_borders().has_top();
    if !ctx.intersections_vertical.is_empty() && has_horizontal {
        let mut splits = ctx.intersections_vertical;
        let mut splits = short_splits(&mut splits, ctx.size.width);
        squash_splits(&mut splits);

        let c = cfg.cfg.get_borders().right_intersection.unwrap_or(' ');
        table.with(SetLeftChars(&splits, c));
    }

    let table = table.to_string();

    CellData::new(table, vec![ctx.size.width], vec![ctx.size.height])
}