I am documenting my C/C++ code with doxygen. I want to collect the documentation for a (long) list of parameters in one single table: Each row of the table should have a short piece of code such that each parameter is documented where it is handled (e.g., first column parameter name, second column parameter explanation / default value / etc.). So, it is required the the comments of this long table are fragmented into many pieces.
Consider the following piece of documentation. A first table has an “interruption” while the second has none.
/// \file main.cpp
/// \brief main function
int main () {
/// <table>
/// <tr> <td> 1 <td> 2
// some code
/// <tr> <td> 3 <td> 4
/// </table>
/// <table>
/// <tr> <td> 1 <td> 2
/// <tr> <td> 3 <td> 4
/// </table>
}
In the same directory as this file (called main.cpp
), I run doxygen -g cfg
and doxygen cfg
. This creates (among others) a file html/main_8cpp.html
. The doxygen version is 1.8.17.
The output of the first table is not really satisfying. Splitting the comment for the table leads to an unintended line break, and subsequently an ugly appearance of the entry in the last column.
I tried manually ending the row of the table with </td> </tr>
but the line-breaking behavior stayed the same.
Can this behaviour be avoided?
If I look into the html source, the output of the two tables is different.
<p>main function </p>
<table class="doxtable">
<tr>
<td>1 </td><td><p class="starttd">2 <br />
</p>
<p class="endtd"></p>
</td></tr>
<tr>
<td>3 </td><td>4 </td></tr>
</table>
<table class="doxtable">
<tr>
<td>1 </td><td>2 </td></tr>
<tr>
<td>3 </td><td>4 </td></tr>
</table>
The problem is the paragraph <p class="starttd">2 <br /> </p>
(the <p>
tags, not the <br>
). If I remove them, the line break dissapears.