I am wondering if there is some cut and paste code to create an accessible table since this issue comes up so often in ID consults.
Yes, the main thing for tables is to use them for data display (not layout) and for the header cells to be indicated separately from the data cells. The headers can be for columns and/or rows.
Here is an example of a table with column headers:
And here is the code for that table:
<caption>Governors of California:</caption>
<th scope="col">Years in Office</th>
<td>New York City</td>
Retrieving data ...