def adjust_bbox_with_padding(
    bbox: Tuple[float, float, float, float],
    page_width: float,
    page_height: float,
    padding_pct: float,
) -> Tuple[float, float, float, float]:
    """
    Adjusts the bounding box to include padding based on a percentage of its size.

    :param bbox: The original bounding box (x0, y0, x1, y1).
    :param page_width: The width of the page to ensure the padded bbox does not exceed its bounds.
    :param page_height: The height of the page to ensure the padded bbox does not exceed its bounds.
    :param padding_pct: The percentage of padding to add to each side of the bounding box.
    :return: A new bounding box adjusted for padding.
    """
    x0, y0, x1, y1 = bbox
    # Calculate the width and height of the original bounding box
    bbox_width = x1 - x0
    bbox_height = y1 - y0

    # Calculate padding in pixels for each dimension
    padding_x = bbox_width * padding_pct
    padding_y = bbox_height * padding_pct

    # Adjust the bounding box coordinates with padding
    padded_x0 = max(x0 - padding_x, 0)  # Ensure x0 is not less than 0
    padded_y0 = max(y0 - padding_y, 0)  # Ensure y0 is not less than 0
    padded_x1 = min(x1 + padding_x, page_width)  # Ensure x1 does not exceed page width
    padded_y1 = min(
        y1 + padding_y, page_height
    )  # Ensure y1 does not exceed page height

    return padded_x0, padded_y0, padded_x1, padded_y1

    Adjusts the bounding box to include padding based on a percentage of its size.

    :param bbox: The original bounding box (x0, y0, x1, y1).
    :param page_width: The width of the page to ensure the padded bbox does not exceed its bounds.
    :param page_height: The height of the page to ensure the padded bbox does not exceed its bounds.
    :param padding_pct: The percentage of padding to add to each side of the bounding box.
    :return: A new bounding box adjusted for padding.
    
src/openparse/tables/utils.py