Howto "glue" input fields?
This is an excerpt from properties_render.py. You can right click the property and choose Edit Source.

The properties are drawn using UILayout.column(). Specifically, it is the align=True, a property of the column, which causes the properties to appear to be 'glued' together.

def draw(self, context):
    layout = self.layout

    scene = context.scene
    rd = scene.render

    row = layout.row(align=True)
    row.menu("RENDER_MT_presets", text=bpy.types.RENDER_MT_presets.bl_label)
    row.operator("render.preset_add", text="", icon='ZOOMIN')
    row.operator("render.preset_add", text="", icon='ZOOMOUT').remove_active = True

    split = layout.split()

    col = split.column()
    sub = col.column(align=True)
    sub.label(text="Resolution:")
    sub.prop(rd, "resolution_x", text="X")
    sub.prop(rd, "resolution_y", text="Y")
    sub.prop(rd, "resolution_percentage", text="")