From the IUPAC red book:
The groups of elements in the periodic table (see inside front cover) are numbered from 1 to 18. The elements (except hydrogen) of groups 1, 2 and 13–18 are designated as main group elements and, except in group 18, the first two elements of each main group are termed typical elements. Optionally, the letters s, p, d and f may be used to distinguish different blocks of elements. For example, the elements of groups 3–12 are the d-block elements. These elements are also commonly referred to as the transition elements, though the elements of group 12 are not always included; the f-block elements are sometimes referred to as the inner transition elements. If appropriate for a particular purpose, the various groups
may be named from the first element in each, for example elements of the boron group (B, Al, Ga, In, Tl), elements of the titanium group (Ti, Zr, Hf, Rf), etc.
The following collective names for like elements are IUPAC-approved: alkali metals
(Li, Na, K, Rb, Cs, Fr), alkaline earth metals (Be, Mg, Ca, Sr, Ba, Ra), pnictogens$^8$ (N, P, As, Sb, Bi), chalcogens (O, S, Se, Te, Po), halogens (F, Cl, Br, I, At), noble gases (He, Ne, Ar, Kr, Xe, Rn), lanthanoids (La, Ce, Pr, Nd, Pm, Sm, Eu, Gd, Tb, Dy, Ho, Er, Tm, Yb, Lu), rare earth metals (Sc, Y and the lanthanoids) and actinoids (Ac, Th, Pa, U, Np, Pu, Am, Cm, Bk, Cf, Es, Fm, Md, No, Lr).
So to decide which block La and Ac belong to, you would have to know which group they are in (group 3 or no group). In the periodic table shown in the same document, there is only an asterisk in period 6 and 7 group 3. So according to the red book, La and Ac (and Lu and Lr) are in the f-block.
If a periodic table shows elements in group 3, this would imply they are in the d-block. This is true even if they are color-coded in the same way as the lanthanoids and actinoids.
The IUPAC red book also makes a statement about the terms lanthanide and actinide:
Although lanthanoid means ‘like lanthanum’ and so should not include lanthanum,
lanthanum has become included by common usage. Similarly, actinoid. The ending ‘ide’ normally indicates a negative ion, and therefore lanthanoid and actinoid are preferred to lanthanide and actinide.
The placement of La and Ac in the periodic table is debatable, and maybe one day IUPAC will change its mind.