The Sages’ prohibition of playing instruments includes dancing, clapping, and slapping one’s thigh with one’s hands to accompany singing out of concern lest one play an instrument and fix it (Beitza 36b). However, one may clap with a shinui, such as using the back of one’s hand; by using a shinui, he is reminded that it is Shabbat and will not end up fixing an instrument (y. Beitza 5:2). It would seem that very muted dancing, in which one’s feet never leave the ground at the same time, is not included in the prohibited dancing (ibid.).
The prohibition applies specifically while singing, because there is a concern then that it will lead to playing instruments. In contrast, if there is no singing, one may jump a bit for his enjoyment. Similarly, one may clap or to bang on a table in order to wake someone up.
In practice, many observant Jews dance, clap, and bang on a table when they sing on Shabbat. The poskim disagree about the legitimacy of this practice, as follows.
One approach, that of many poskim, is that this practice is mistaken. The only reason that the Sages did not object is that the prohibition is not stated explicitly in the Torah, so it is better that people transgress unknowingly rather than knowingly (Beitza 30a). However, if there is any possibility that people can be convinced to accept the proper halakha, we must teach them not to clap or dance on Shabbat, in accordance with the rabbinic enactment (Rif; Rambam; Rema 339:3). Nevertheless, on Simĥat Torah, when there is a special mitzva to rejoice and honor the Torah, even those who are normally stringent dance and clap (Maharik in the name of R. Hai Gaon). However, for other celebrations with a mitzva component, such as weddings, they are not lenient (MB 339:8).
A second approach defends the leniency. After all, the reason behind the prohibition is a concern that people will end up fixing a musical instrument. Nowadays, when those who play an instrument do not know how to fix it, the enactment no longer applies, and one may dance and clap on Shabbat (Tosafot, Beitza 30a, s.v. “tenan”). Some do not accept this, maintaining that all the players know how to tune their instrument (tightening guitar strings, harp strings, or the top of a drum), which is considered fixing an instrument. However, there is a different reason to be lenient. Some maintain that the rabbinic enactment was specifically relevant to the times of the Sages, when people would take out instruments whenever there was dancing and clapping. Nowadays, when many people sing, dance, and clap without instruments, the enactment no longer applies (AHS 339:9).
A third approach notes that the great Ĥasidic masters of recent centuries focused on the value of music and dance to awaken people’s hearts to cling to God joyfully. Such dancing and clapping are considered true mitzva needs. Accordingly, just as there is a leniency for Simĥat Torah, there should be a leniency for every Shabbat (Devar Yehoshua 2:42:4).
It would seem that even those who are lenient should not drum on the table on Shabbat. Such drumming is very similar to that of an actual drum, which all agree is forbidden, even for the sake of a mitzva. Furthermore, the concern that people will take out a drum is a serious one today, when many are used to bringing drums, darbukas, and the like when they sing. In contrast, when people are singing during prayer, a leader may drum with his hand on the bima. One leading the songs at the Shabbat table may also be lenient.