<!DOCTYPE html><style type="text/css">
.flex {
    display: flex;
}
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.w-fit {
    width: fit-content;
}
</style><div class="flex"><div class="grid"><div class="w-fit">Col1</div><div class="w-fit">Col2</div>