Both the ZX80 and the ZX81 had a variable-size display file (DFILE). They didn't store the complete screen contents, but rather only the characters per line up to a terminating newline. This collapsed DFILE is activated when the ZX detects less than 3 1/4kB of memory on startup. A collapsed DFILE can thus be as small as 24+1 bytes (initial HALT, 24 NEWLINEs, or HALT instructions) for an empty screen.
Because ZX-80 and ZX-81 "execute" the DFILE in the display output routine as NOPs, the terminating newline character has to be the opcode of a HALT instruction (76h). This stops the CPU fetching bytes from the DFILE and makes it internally execute NOPs until interrupted (which happens at the end of each scanline, 8 times per character line). The video hardware simply generates white space pixels for the rest of the line.
This results in much less screen memory used than the 768 bytes you would otherwise need for a full screen, at least if you did not fill the complete lines with 32 characters.
Here is a detailed description of how this works (on Grant Searle's great Z80 pages).