A Virginia House of Delegates committee, in a surprising defeat for Gov. John N. Dalton and his supporters, today narrowly approved a bill repealing half of Virginia's 4 percent sales tax on food and giving a tax credit to low- and middle-income families on the remaining half.

The House Finance Committee's 10-to-8 vote -- the first time in memory that even a partial repeal of the controversial tax has won the panel's approval -- sets the stage for the first and perhaps only major legislative confrontation over taxes and the state budget when the full House debates and votes on the measure next week.

Dalton, a Republican, has asked the legislators to spend nearly all of the state's estimated $201 million budget surplus by shoring up state programs wracked by inflation. While the General Assembly's Democratic leadership has supported his proposal, a number of maverick lawmakers have pushed for a tax cut and have focused on repeal of the food tax, a perennial legislative issue for nearly a decade.

"It seems to me that this committee is entitled to reduce taxes when we have this kind of money lying around," said House Finance Chairman Archibald A. Campbell (D-Wythe), sponsor of the bill and a leader of the mavericks.

The measure would not begin to take effect until 1982 and would cost the state an estimated $110 million in its first year. The tax-credit portion of the bill would take effect in 1984 and grant families with annual incomes below $20,000 and $18-per-year credit on their state income tax returns.

Opponents contended the bill was a politically motivated gimmick by election-conscious delegates and predicted that, if passed, it would inevitably lead to cuts in vital state services such as Medicaid, education and welfare.

"I believe the very people you want to help here are going to be hurt the most," said Del. Norman Sisisky (D-Petersburg), who called the vote "very political . . . there was a lot of fun and games being played around here."

A bill giving tax credits for food tax payments was narrowly defeated last year by the House. Supporters predicted then that the prospect of this fall's elections would sway enough members to assure passage of this year's bill. "I wouldn't count on it, but if I were a gambling man, I'd give it a 60 to 40 chance," said House Majority Leader Thomas W. Moss (D-Norfolk).

To pass, the bill must survive strong opposition from legislative leaders such as House Speaker A. L. Philpott, who appeared stunned to hear of the committee's vote and said he had "serious misgivings" about the proposal. Philpott refused to predict how the House would vote, but another lawmaker said of the speaker, "he'd sooner have leprosy" than allow the bill to pass.

Should the bill pass the House, it would then face an even tougher test in the state Senate, whose members do not face reelection until 1983. Influential Senate Finance Chairman Edward E. Willey (D-Richmond) has vowed to scuttle any tax-cut bill that is not accompanied by a parallel cut in state spending.

Today's House Finance vote cut across party lines, with all four Northern Virginians -- two Democrats and two Republicans -- voting for the bill. Arlington Democrat Warren G. Stambaugh predicted the measure could pass the House floor. "If we get to the Senate, anything can happen," he said.

Dalton has not indicated what action he would take should the bill pass both houses. Press secretary Charles Davis said the administration had no comment on today's action.Many lawmakers said they believe the governor would almost certainly veto the measure and that the veto might then become a key issue in this fall's political campaign.