This question already has an answer here:

In a Star Destroyer we see people walking around , so there has to be some kind of artificial gravity.

In this question, How does the Death Star gravity work? there is a pretty clear explanation on how gravity is generated on the Death-Star.

What is the explanation of how gravity is generated on a Star Destroyer?

marked as duplicate by KyloRen, Community Oct 10 '16 at 7:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    While I suppose that we need separate questions for asking how the Millenium Falcon’s gravity works and how the Death Star’s gravity works because the Death Star explanation doesn’t work for the Millenium Falcon, I don’t think we need this for every ship in Star Wars. Surely the Star Destroyer generates gravity in rather a similar way to the Falcon? – Adamant Oct 10 '16 at 7:42
  • @Adamant, did not see that. If someone wants to answer, please do, in the mean time I am voting for it to be closed. Oh, you can't answer a closed question,. – KyloRen Oct 10 '16 at 7:46