Hi Kim,
Yes, there's a way to do this. It's not that obvious.
For some parameters, there are extra control types that will support a different appearance and behaviors.
What you're seeing is the default control for a parameter with a Value Table data type. By default, someone can add multiple sets of values.
But, you can modify this default behavior by setting the parameter object's controlCLSID property.
So, for example, with my own code, if I create a Value Table parameter with the default control, you get this (similar to your example):
param1 = arcpy.Parameter(
displayName='Arterials Weights',
name='arterials_weights',
datatype='GPValueTable',
parameterType='Required',
direction='Input',
)
param1.columns = [['GPString', 'A'], ['GPString', 'B'], ['GPString', 'C'], ['GPString', 'D'], ['GPString', 'E']]
If I use the same parameter information, but then also set the controlCLSID value to a string of '{1A1CA7EC-A47A-4187-A15C-6EDBA4FE0CF7}', I get the following appearance, limiting the Value Table to single set of values.
param1 = arcpy.Parameter(
displayName='Arterials Weights',
name='arterials_weights',
datatype='GPValueTable',
parameterType='Required',
direction='Input',
)
param1.columns = [['GPString', 'A'], ['GPString', 'B'], ['GPString', 'C'], ['GPString', 'D'], ['GPString', 'E']]
param1.controlCLSID = '{1A1CA7EC-A47A-4187-A15C-6EDBA4FE0CF7}'
There's some other examples here: https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/parameter-controls.htm. It's not a complete list, and it doesn't include this one (it should).
Does that help? Let me know if you have any questions.
-Dave