We develop a minimal model to explore coevolutionary dynamics on spatial ultimatum game. Individuals are endowed with the capacity to adjust both their strategy and their social ties. Under strategy dynamics, individuals preferentially imitate the strategy of more successful neighbors. Meanwhile, the egoists, whose offers do not satisfy the partners, run the risk of being dismissed. We find that individuals make fairer offers when they are allowed to switch adverse partnerships. Remarkably, the promotion of fairness by partner rewiring is offset in a certain extent by the emergence of isolated individuals. We also investigate the influence of the average degree on the evolution of fairness under our coevolutionary rules. It is found that a smaller average degree leads to a fairer society under the condition of low partner rewiring frequency. However, if partner rewiring frequency is high, a dense network where isolated individuals are not apt to emerge, is favorable for the establishment of fairness.