YouTube Grid Column Customizer

Adjust the number of video columns on YouTube

As of 2025-04-21. See the latest version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         YouTube Grid Column Customizer
// @namespace    https://violentmonkey.github.io/
// @version      0.2
// @description  Adjust the number of video columns on YouTube
// @author       Bui Quoc Dung
// @match        https://www.youtube.com/*
// @grant        GM_addStyle
// ==/UserScript==
(function () {
    "use strict";

    GM_addStyle(`
        /* Mặc định: 3 cột */
        ytd-rich-grid-renderer {
            --ytd-rich-grid-items-per-row: 3 !important;
        }

        /* Desktop lớn */
        @media (min-width: 1200px) {
            ytd-rich-grid-renderer {
                --ytd-rich-grid-items-per-row: 4 !important;
            }
        }

        /* Tablet nhỏ hơn  */
        @media (max-width: 800px) {
            ytd-rich-grid-renderer {
                --ytd-rich-grid-items-per-row: 2 !important;
            }
        }
    `);
})();