Skip to content

Commit 6f5660c

Browse files
committed
Allow setting a cell's min_width and max_width properties
1 parent da04233 commit 6f5660c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/prawn/table/cell.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ def max_width
112112
#
113113
attr_writer :height
114114

115+
# Manually specify the cell's min_width
116+
#
117+
attr_writer :min_width
118+
119+
# Manually specify the cell's max_width
120+
#
121+
attr_writer :max_width
122+
115123
# Specifies which borders to enable. Must be an array of zero or more of:
116124
# <tt>[:left, :right, :top, :bottom]</tt>.
117125
#

lib/prawn/table/cell/text.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ def set_width_constraints
8282
unless defined?(@min_width) && @min_width
8383
min_content_width = [natural_content_width, styled_width_of_single_character].min
8484
@min_width = padding_left + padding_right + min_content_width
85-
super
8685
end
86+
87+
super
8788
end
8889

8990
protected

0 commit comments

Comments
 (0)