| D | Table.kt | 8 * http://www.apache.org/licenses/LICENSE-2.0 13 * See the License for the specific language governing permissions and 22 private val columns: Int, constant in com.facebook.ktfmt.kdoc.Table 33 * Format the table. Note that table rows cannot be broken into multiple lines in Markdown tables, 34 * so the [maxWidth] here is used to decide whether to add padding around the table only, and it's 39 2 + widths.sumOf { it + 2 } // +2: "| " in each cell and final " |" on the right in format() 42 val lines = mutableListOf<String>() in format() constant 56 "%-${width}s", in format() 57 String.format("%${cell.length + (width - cell.length) / 2}s", cell)) in format() 61 String.format("%-${width}s", cell) in format() [all …]
|