function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Daryl MoonDaryl Moon 

How can I reduce the size of a datatable input field?

I have a screen flow that uses Eric Smith's datatable component. In this flow I have a quantity field that I want the user to enter a number (eg 1-100) but when you click (inline edit) to enter the value, the input field is enormous and it overlays the other fields. How can I reduce the size of this? I asked Eric and he said that his datatable flow component uses the Salesforce base datatable. He suggested that it's possible a CSS override could be used but SF has not published any details about the innards of this component. Does anyone have any ideas on how this could be achieved?

PS: The size of the quantity field as defined in the object and the width of the field in Eric's datatable component configuration have no impact on this, it's inherent in the underlying Salesforce datatable.

User-added image

ravi soniravi soni
hi,
you need to add   initialWidth: 34, this in the column which width you want to customize.
try below dummy code for reference.
{
                label: "Name",
                fieldName: "Name",
                type: "text",
              initialWidth: 34,
                

            },

don't forget to mark it as best answer if it helps you.
Thank you
Daryl MoonDaryl Moon
If I am building this in flow, where does this code go?