The difference between “//W3C//DTD HTML 4.01” and “//W3C//DTD XHTML 1.0” is that the former has “HTML 4.01” as opposite to “XHTML 1.0” in the latter.
What you have actually observed is the difference between the two document type declarations
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
and
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
The former puts browsers to “standards mode”, whereas the latter puts them to “quirks mode”. In quirks mode, strange things may and will happen. This may include nonstandard calculation of widths and heights.
Unless this is about a legacy page that relies on quirks mode, you should use “standards mode” and use CSS and DOM by the specifications.