You may be referring to the Chidushei Chasam Sofer on Bava Basra 57b. The gemara there states as follows:
בעא מיניה ר' יוחנן מרבי בנאה... שלחן של ת"ח כיצד שני שלישי גדיל ושליש גלאי ועליו קערות וירק וטבעתו מבחוץ והא תניא טבעתו מבפנים לא קשיא הא דאיכא ינוקא הא דליכא ינוקא ואי בעית אימא הא והא דליכא ינוקא ולא קשיא הא דאיכא שמעא הא דליכא שמעא ואי בעית אימא הא והא דאיכא שמעא ולא קשיא הא ביממא הא בליליא
R. Johanan asked R. Bana'ah13... How should the table of a talmid hakam be laid? He replied: Two-thirds should be covered with a cloth and the other third should be uncovered for putting the dishes and vegetables on;17 and the ring18 should be outside.19 But has it not been taught that the ring should be inside?20 — There is no contradiction. In one case [we suppose] there is a child at the table,21 and in the other that there is no child. Or if you like I can say [that in both cases [we suppose] there is no child, and still there is no contradiction: in one case [we suppose] there is a waiter at table22 and in the other there is no waiter.23 Or if you like I can say that in both cases [we suppose] there is a waiter, and still there is no contradiction; in the one case we refer to the day24 and in the other to the night.
13 Having mentioned R. Bana'ah the text adduces a number of his sayings and doings. ...
17 So that they should not dirty the cloth. According to some, the bare space was to be in the middle.
18 By which the table-top was hung up when not in use.
19 I.e., on the bare part.
20 I.e., the part near the guests.
21 And then it should be outside, because otherwise the child may play with it and upset the table.
22 And it should be inside, because if it is outside, it may get in his way.
23 And it should be outside, so as not to get in the way of the company.
24 When the waiter can avoid it, and therefore the convenience of the company can be consulted by having it outside.
The Chasam Sofer (here) interprets this passage homiletically:
ואמר בשולחן של ת"ח שטבעתו שהשולחן תלוי בו מבפנים או מבחוץ היינו שפרנסתו מעצמו היינו מבפנים או מבחוץ והא בלית לי' ינוקא רק הוא בעצמו כן עשה הלל משתכר בטערפיק ונדחק ביגיע כפו ולא פנה חוץ להזמין לו פרנסה והיינו בדלית לי' ינוקא. אך בדאית ליה ינוקא ורוצה לגדלם לתורה ועבודה א"א בזה אלא טבעתו מבחוץ. והא דאית שמעא כשמעון אחי עזרי' והא ביממא פי' שאותו הנותן נותנו בעין יפה ושמח שזכה לכך כדכתי' שמח זבולון בצאתך שזכית שיששכר באהלך אבל אי נותן בעין רע ות"ח שנהנה ממנו מתבייש כסומך על שלחן אחרי' שהעולם חשך בעדו והיינו בליליא לא יקבע טבעתו בחוץ אלא יפשוט נבלה בשוק ולא יצטריך ללחום לחם רע עין.
And when R' Bana'a says regarding the table of a Torah scholar that the ring of the table hangs in it1 from the inside or the outside, this means that the livelihood that the Torah scholar provides can be from the inside or the outside. And this applies when he has no children, and it is just himself. This is what Hillel did; he earned a tarf'ik2 daily, and he made a meager livelihood by the toil of his hands. He did not turn outward [to others] to provide an income for him.
And this applies when one does not have children. However, when he does have children, and he wishes to raise them in Torah and divine service,3 it is impossible to conduct one's livelihood this way. Rather, "his ring is from the outside."
Regarding "if he has an attendant" ("שמעא"), this refers to a situation like that of Shim'on the brother of 'Azarya.4
And regarding "if it is during the day," the explanation is that the person who gives the scholar financial support should give it graciously and rejoice that he merited the opportunity to do so, as the verse states (D'varim 33:18), "Rejoice, Zevulun, in your expeditions," for you have merited to have "Yissachar in your tents".5
But if the benefactor gives begrudgingly, and the Torah scholar benefits from him, the scholar will be embarrassed like one who relies for his sustenance on the table of others, for the world will have become dark for him.6 And this is the meaning of, "At night, he should not set his ring on the outside." Rather, he should flay carcasses in the marketplace7 rather than need to be sustained from the bread of a begrudging eye.
1 "תלוי בו", which could also be translated as "dependent on him."
2 A טרפעיק coin is worth half of a dinar (K'subos 64a, "מאי טרפעיקין אמר רב ששת אסתירא וכמה אסתירא פלגא דזוזא"). Hillel used half of that daily income to support himself and his household ("וחציו לפרנסתו ולפרנסת אנשי ביתו", Yoma 35b). Apparently, the Chasam Sofer assumes either that Hillel's "household" did not yet include children or that Hillel did not adhere to the lesson that the Chasam Sofer reads into R' Bana'a's words.
3 Alternatively, perhaps this could be translated as "raise them to study Torah and work for a living."
4 Shim'on was a tanna whose Torah study was supported financially by his brother 'Azarya (Sota 21a, Rashi s.v. "שמעון אחי עזריה"). Hillel on the other hand, did not accept financial assistance from his brother Shevna (or Shachna). It seems that the reason Hillel did not accept is that Shevna wanted a share in Torah study that Hillel had already accomplished prior to the arrangement (ibid., "לסוף א"ל תא נערוב וליפלוג"). However, see Maharsha (ad loc.) who indicates that Hillel behaved more meritoriously than Shim'on and R' Yochanan d'vei N'si'a because he did not accept money from others to allow him to learn Torah.
5 See B'reishis Rabba 72:5 and 99:9 and Vayikra Rabba 25:1.
6 Cf. 'Avoda Zara 8a, "ת"ר לפי שראה אדם הראשון יום שמתמעט והולך אמר אוי לי שמא בשביל שסרחתי עולם חשוך בעדי וחוזר לתוהו ובוהו" ("Woe is me! Perhaps because I sinned, the world has become dark for me").
7 See P'sachim 113a, "פשוט נבילתא בשוקא ושקיל אגרא ולא תימא כהנא אנא וגברא רבא אנא וסניא בי מלתא" ("Flay a carcass in the marketplace and take a salary, and don't say, 'I am a Kohein, and I am a great person, and the matter offends me!'"). In perhaps a double entendre, "פשוט נבילתא בשוקא ושקיל אגרא" may also be translated as, "Put your body out in the marketplace, and earn a salary."