TableLayout выходит за границы экрана

Имеется Fragment c TableLayout которая находиться в ConstraintLayout. Этот фрагмент вставляется в Activiti

<TableLayout
        android:id="@+id/tableLayout3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent">

        <TableRow
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:background="@color/tableHeader"
            android:orientation="vertical">

            <TextView
                style="@style/textTableHeader"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="0.5"
                android:text="@string/column_name_provider" />

        </TableRow>

        <TableRow
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:baselineAligned="false"
            android:orientation="vertical">

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/recyclerViewWeightTab"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                tools:listitem="@layout/item_doc_weight_table" />
        </TableRow>

        <TableRow
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:baselineAligned="false"
            android:orientation="vertical">

            <TextView
                style="@style/textTableSelection"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/column_name_summa" />
        </TableRow>
</TableLayout>

Но почему то таблица, если она больше экрана выходит за границы. Как сделать чтобы она расширялась до границ экрана, а далее был скрол?

Пример маленькой таблицы

Пример большой таблицы


Ответы (0 шт):