function generateGrid(contents, columnsPerRow) { // 计算需要的总行数 const totalItems = contents.length; const rows = Math.ceil(totalItems / columnsPerRow); // 生成网格 for (let i = 0; i < rows; i++) { document.writeln(''); // 生成当前行的列 for (let j = 0; j < columnsPerRow; j++) { const index = i * columnsPerRow + j; if (index < totalItems) { const item = contents[index]; document.writeln(` ${item.text} `); } } document.writeln(''); } } // 定义内容(可以无限增加) const contents = [ { text: "海量看片资源", href: "/" }, { text: "户外直播", href: "/" }, { text: "性感直播", href: "/" }, { text: "直播自慰", href: "/" }, { text: "热舞直播", href: "/" }, { text: "明星直播", href: "/" }, { text: "骚逼直播", href: "/" }, { text: "辣妹直播", href: "/" }, { text: "💕 附近邻居", href: "/" }, { text: "💕饥渴难耐", href: "/" }, { text: "❤️父女乱伦", href: "/" }, { text: "❤️萝莉公主", href: "/" }, { text: "自拍偷拍", href: "/" }, { text: "经典三级", href: "/" }, { text: "巨乳少妇", href: "/" }, { text: "精品动漫", href: "/" }, // 可以继续添加更多内容 ]; // 生成网格,每行2列 generateGrid(contents, 2); 91720