The chairs need 6 chairs * 4 legs = <<6*4=24>>24 furniture legs.
This means they are using 40 legs in total – 24 legs for chairs = <<40-24=16>>16 legs for the tables.
They have therefore made 16 legs / 4 legs per table = <<16/4=4>>4 tables.
#### 4