<?php

$arr = [
    [
        'COLOR'    => 'Red',
        'WEIGHT'   => 20
    ],

    [
        'COLOR'    => 'Red',
        'WEIGHT'   => 25
    ],

    [
        'COLOR'    => 'Red',
        'WEIGHT'   => 30
    ],

    [
        'COLOR'    => 'Green',
        'WEIGHT'   => 20
    ],

    [
        'COLOR'    => 'Green',
        'WEIGHT'   => 25
    ],

    [
        'COLOR'    => 'Green',
        'WEIGHT'   => 30
    ]
];

$out = [];

foreach ($arr as $a) {
    $out[$a['COLOR']][] = $a['WEIGHT'];
}

?>

<table>
    <?php foreach ($out as $key => $arr) { ?>
        <tr>
            <th><?= $key ?></th>
        </tr>
        <?php foreach ($arr as $item) { ?>
            <tr>
                <td>
                    <div>
                        <input type="text" value="<?=$item?>">
                    </div>
                </td>
            </tr>
        <?php } ?>
    <?php } ?>
</table>