class_docstr: A TablePlot can plot both TableViews and ViewMaps which display
  as either a single static table or as an animated table
  respectively.
class_docstr_tok: ["A","TablePlot","can","plot","both","TableViews","and","ViewMaps","which","display","as","either","a","single","static","table","or","as","an","animated","table","respectively","."]
code: def _update_cell_widths(self, element, cell_widths):
      # Mapping from the cell coordinates to the dictionary key.
      summarize = element.rows > self.max_rows
      half_rows = self.max_rows // 2
      rows = min([self.max_rows, element.rows])
      for row in range(rows):
          adjusted_row = row
          for col in range(element.cols):
              if summarize and row == half_rows:
                  cell_text = "..."
              else:
                  if summarize and row > half_rows:
                      adjusted_row = element.rows - self.max_rows + row
                  cell_text = element.pprint_cell(adjusted_row, col)
                  if len(cell_text) > self.max_value_len:
                      cell_text = (
                          cell_text[: (self.max_value_len - 3)] + "..."
                      )
              if len(cell_text) + 2 > cell_widths[col]:
                  cell_widths[col] = len(cell_text) + 2
  
file_path: holoviews/holoviews/plotting/mpl/tabular.py
imports: from collections import defaultdict
  import param
  from matplotlib.font_manager import FontProperties
  from matplotlib.table import Table
  from .element import ElementPlot
  from .plot import mpl_rc_context
label_desc: Use image node_id 3 for calling the TablePlot obj's underlying member method code with example usage: obj._update_cell_widths(element, cell_widths) without return types