Although sugar is a solid it takes the shape of the container in which it's kept. Why?
Look sugar particles are solid and do not take the shape of a container but since the particles are of very small size which makes them difficult to distinguish from one another if consider in a large number, so as a whole they take the form/shape of a container.