Tartan patterns have been used in Scottish weaving for centuries. For many centuries, the patterns were associated with the weavers of a particular area. The naming and registration of official clan tartans did not begin until the Highland romantic revival of the 19th century.
The tartan of a Scottish clan is a sequence of colors and shades unique to the material, authorised by the clan society for use by members of that clan for kilts, ties, and other garments and decorations. Every clan with a society, has at least one distinct tartan. While "heraldic" in the sense of being visual representation of blood relation, they are not "Scottish heraldry", strictly speaking. In Scotland, heraldry is protected under the law by the court of the Lord Lyon, King of Arms, and there are penalties for bearing an unauthorised Coat of arms. On the other hand, there is no blanket legal prohibition against wearing the "wrong" tartan.
In addition to the clan tartans, tradition reserves some patterns for use by Scottish Highland military units of the United Kingdom and Commonwealth countries.
Those associated with the British Royal Family use the Royal Stewart tartan regardless of whether they are affiliated by blood to the Stewart clan. This is because of the Royal Family's Stewart ancestry through James VI of Scotland.
However tartan is pretty inclusive. Tartans have been designed for commercial companies, special interest groups, cities, football clubs, etc. As a result most people, whether of Scottish ancestry or not, can find some tartan which is significant for them. There are also general fashion tartans for those who do not care about the significance.