Tide tables, sometimes called tide charts, are used for tidal prediction and show the daily times and heights of high water and low water, usually for a particular location. Tide heights at intermediate times (between high and low water) can be approximately calculated using the rule of twelfths or more accurately by using a published tidal curve for the location.
Tide tables are published in various forms, such as paper-based tables and tables available on the Internet. Most tide tables are calculated and published only for major ports, called "standard ports", and only for one year — standard ports can be relatively close together or distant hundreds of kilometers. The tide times for a minor port are estimated by the tide-table user manually calculating using the published time and height differences between a "standard" port and the minor port.
The dates of spring tides and neap tides, approximately seven days apart, can be determined by the heights of the tides on the classic tide tables: a small range indicates neaps and large indicates springs.
The cycle of tides is dependent on the phase of the moon, such that the highest tides spring tides occur near full moon and new moon. As the lunar cycle is about 29.5 days, successive tides are approximately 24/29th of an hour later each day or about 50 minutes but many other observations and considerations are required to develop accurate tide tables. On the Atlantic coast of northwest Europe, the interval between each low and high tide averages about 6 hours and 10 minutes, giving two high tides and two low tides each day, with the highest tides about 2 days after full moon.
Tide prediction was long beset by the problem of laborious calculations; and in earlier times, before the use of digital computers, official tide tables were often generated by the use of a special-purpose calculating machine, the tide-predicting machine.
You can find a code example of tide calculation by Arthur Thomas Doodson based on data from Long Island Sound.