Contempt of court is independent of the original cases criminal vs civil distinction.
You can have criminal contempt in a civil case and criminal contempt in a civil case. The rules vary by state but in PA it’s civil contempt is used to force people to comply where criminal is punishment for disobedience.
Are you under the impression that judges presiding over civil cases cannot exercise their inherent power (in some jurisdictions) to jail those in (severe) contempt of court?
If there was then a lot of America would become slaves by not paying their debts. There may be contempt here though if Elon does something to really piss off the courts.