code: def prepare_headers(table, bound_columns):
      
      if table.request is None:
          return
  
      for column in bound_columns:
          if column.sortable:
              params = table.request.GET.copy()
              param_path = _with_path_prefix(table, 'order')
              order = table.request.GET.get(param_path, None)
              start_sort_desc = column.sort_default_desc
              params[param_path] = column.name if not start_sort_desc else '-' + column.name
              column.is_sorting = False
              if order is not None:
                  is_desc = order.startswith('-')
                  order_field = order if not is_desc else order[1:]
                  if order_field == column.name:
                      new_order = order_field if is_desc else ('-' + order_field)
                      params[param_path] = new_order
                      column.sort_direction = DESCENDING if is_desc else ASCENDING
                      column.is_sorting = True
  
              column.url = "?" + params.urlencode()
          else:
              column.is_sorting = False
docs: :type bound_columns: list of BoundColumn