[Tex/LaTex] Changing Table Numbering Scheme to Include Section Number

numberingtables

When I create a table and use \caption, Latex automatically adds "Table 1.1" or something similarly numbered. I'm using the book format, and want the caption numbering to be of the form "Table x.y.z", where x is the chapter number, y is the section number, and z is the table number within x.y. For example, the second table in section 4 in chapter 2 should say "Table 2.4.2".
How do I make Latex change the numbering of the tables?

Best Answer

Although your question is closely related to the following question, the numbering scheme you want is different.

The general solution is the same, however:

Use the chngcntr package to determine which counters depend on which. In your case, you want the table counter to depend on the section counter, so you add

\usepackage{chngcntr}
\counterwithin{table}{section}
Related Question