$table = setTable(['Name', 'Age'], [['John', '25'], ['Jane', '30']]); echo $table;
$result = mysqli_query($conn, "SELECT * FROM customers"); $data = []; while ($row = mysqli_fetch_assoc($result)) { $data[] = [$row['name'], $row['age'], $row['email']]; } $table = setTable(['Name', 'Age', 'Email'], $data, ['class' => 'table-striped', 'style' => 'width: 100%']); echo $table;Output: | Name | Age | Email | |-------|----:|----------------------------| | John | 25 | john@example.com | | Jane | 30 | jane@example.com | | Alice | 20 | alice.smith@example.com | | Bob | 40 | bob.johnson@example.com | Package library: setTable function is not a part of any standardized PHP library or package. However, it is commonly used in various PHP frameworks and libraries, such as Laravel, Yii, and Symfony.