It seems you do not want to select attributes, but check to see if there are all the attributes. I.e:.
$query = $xpath->query('//table[@width and @cellpadding and @cellspacing]');
Or, if you want to specify a table specifically, check the attributes for specific values?
$query = $xpath->query('//table[@width = "100%" and @cellpadding = "6" and @cellspacing = "0"]');
source share