A structure whose ceiling is made out of beams and planks is not a kosher sukka. Although the beams and planks themselves could be acceptable as sekhakh, as they are from plant matter and are not susceptible to tum’a, nevertheless, since the sukka must be a temporary residence, the ceiling of a permanent residence renders it invalid as a sukka.
So that people do not mistakenly sit under a ceiling of beams or planks, the Sages decreed against using planks that are at least 4 tefaḥim (c. 30 cm) wide, as they resemble ceiling beams (Sukka 14a). Nowadays we follow the stricter view and avoid using even planks that are less than 4 tefaḥim wide (SA 629:18; MB ad loc. 49), as it is common to build ceilings out of planks that are narrower than 4 tefaḥim (Kol Bo and Hagahot Maimoniyot). However, beams that are less than a tefaḥ (c. 7.5 cm) wide are not used to build ceilings, so they are acceptable according to all opinions – as long as they are not attached with nails or glue. In times of need, one may use beams more than a tefaḥ but less than 2 tefaḥim wide. Certainly, then, one may use a beam wider than a tefaḥ on which to place the sekhakh. One who wants to paint these planks may do so, as paint does not invalidate the sekhakh.[5]
If one wishes to use a ceiling in the home that is made of planks as a sukka, he must disjoin the planks from their fixed connection and re-place them. Once he has done something to the planks so that they are not a permanent ceiling, they are kosher as sekhakh. However, if the planks were more than 4 tefaḥim wide, then even this action does not make them kosher sekhakh (Rambam; second view in SA 631:9).
Many people use “sekhakh la-netzaḥ,” which is slats or narrow planks connected to one another with string, forming a type of mat. Some say that this sekhakh is invalid, as linking the slats and planks with string causes them to be considered planks that are more than 4 tefaḥim wide, which are invalid due to the decree against ceiling material. However, common practice is not to be concerned for this, as the slats and narrow planks are loosely connected and flexible, and do not resemble the sort of planks used to build ceilings.[6]
[6]. Many poskim are lenient, including my master and teacher R. Avraham Shapira; R. Shlomo Zalman Auerbach, Halikhot Shlomo 8:5; Shevet Ha-Levi 6:74; Az Nidberu 2:66. It is also claimed that the string that holds the mats together is susceptible to tum’a, and one should not support sekhakh with things that are susceptible to tum’a. However, the accepted halakhic view is that even if sekhakh is supported by something susceptible to tum’a, it is still kosher, as is explained in the next section. In addition, as a rule, string is only invalid as sekhakh rabbinically, and many permit supporting the sekhakh with something that is rabbinically invalid as sekhakh. Some books erroneously state that R. Mordechai Eliyahu and R. Yosef Shalom Elyashiv were categorically opposed to the use of mats. However, in Hilkhot Ḥagim 50:39, R. Eliyahu writes that be-di’avad one may rely on those who are lenient. And at the end of Hilkhot Ḥag Be-ḥag, the author says that he showed this type of sekhakh mat to R. Elyashiv and he unhesitatingly permitted it. See Harḥavot 2:4; 5:3.