It's all in-box stuff, and with SQLFORM.factory() I set autofocus by specifying that in the widget option for the appropriate field.
Field('firstid',
requires=[IS_NOT_EMPTY(),IS_INT_IN_RANGE(99900,105000)],
label = "Need picture IDs to swap",
widget = lambda f, v: SQLFORM.widgets.integer.widget(f, v, _autofocus=True)),
Adding
_class = "col-sm-3",
does not change the field appearance, because it doesn't override the default class.
Adding
_style = "width: 50%",
to the field does not change it's appearance, but moving it to the enclosing form definition shrinks the width, but still has two rows stacked.
If I use FORM(), I get the single row picture, but not widgets.
/dps